diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_4ed20a68d545bbcac0a6974406d9b1b1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_2f82a8f66db1e848b6fcf11cf3b40597.json similarity index 68% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_4ed20a68d545bbcac0a6974406d9b1b1.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_2f82a8f66db1e848b6fcf11cf3b40597.json index aabdc9917d..fba27d2816 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_4ed20a68d545bbcac0a6974406d9b1b1.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_2f82a8f66db1e848b6fcf11cf3b40597.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_0183zGtnPWiKWYCcve2rFWrf\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01DS37TZujMbriQPTgxmwaLo\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"

Code

\",\"
console.log('hello world');
\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1141,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":115,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01CGeWBE7kEvSnniyYVHdKfP\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01PFgDX5Jed72dUhEfF26pNL\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"

Code

\",\"
console.log('hello world');
\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1132,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":115,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_a8c0f5688c447808ea40e16816bc9d88.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_c2d9df5eea16a2823b16315808698634.json similarity index 67% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_a8c0f5688c447808ea40e16816bc9d88.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_c2d9df5eea16a2823b16315808698634.json index 4b4867152d..8d0555def4 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_a8c0f5688c447808ea40e16816bc9d88.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_c2d9df5eea16a2823b16315808698634.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01NDgmBLpPXjpsBTK4sfErNy\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01FiKUed7BTXsgaLfdVrytX7\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"\",\"\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1134,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":103,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_011xD5yMq3AK6GgfjMqJawqX\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_017Ckd8wa7L7jP3mrUKnLF1s\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"\",\"\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1125,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":103,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_4200cbf42b5dd56e2fb7c1dc4c0e5c95.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_4a415aef98742a73f1d8e76b31b48fd9.json similarity index 65% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_4200cbf42b5dd56e2fb7c1dc4c0e5c95.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_4a415aef98742a73f1d8e76b31b48fd9.json index 66875f0ba7..e99fea5823 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_4200cbf42b5dd56e2fb7c1dc4c0e5c95.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_4a415aef98742a73f1d8e76b31b48fd9.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01Ek7kYgmf4spzqBFHhouYtT\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_011o6G8D4PEDAxGujpwNLJhc\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

You look great today!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1097,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":74,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_019z7GEMjcu3vBBaw5J7xgf5\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01QLsF6yZhZMi8es5nwfXYPE\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

You look great today!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1088,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":74,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_3cecc2859589d59d7b2a73b271a02ebb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_c3ac403267365e72e1acdeaf703272ac.json similarity index 67% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_3cecc2859589d59d7b2a73b271a02ebb.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_c3ac403267365e72e1acdeaf703272ac.json index 7a64682768..b1bbd01883 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_3cecc2859589d59d7b2a73b271a02ebb.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_c3ac403267365e72e1acdeaf703272ac.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01KzaZaDvG28ztCjJ6RTjwhw\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0138gtKR1dWPWX7GecVvp2cB\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1129,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":86,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01P8xZhZA4UpysrDRcoR1fXz\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_017745HnEiXibB4zBRAmiN8T\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":86,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_0b6e5ba7c365aa004ab09915db4747d2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_a7deaebd8a05b0eacd438ef4772a84b0.json similarity index 67% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_0b6e5ba7c365aa004ab09915db4747d2.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_a7deaebd8a05b0eacd438ef4772a84b0.json index 4d69b10dc1..86892685a2 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_0b6e5ba7c365aa004ab09915db4747d2.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_a7deaebd8a05b0eacd438ef4772a84b0.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_011XHm9ZDt85ctCksKZX7siV\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01DAd7t9r4VXAWruXV5pZW1M\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref1$\",\"position\":\"before\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1129,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":86,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01R4gNBuUEtwLnajdWR214r5\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Ln1VVBRkp5GmTxPNMtNzbG\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref1$\",\"position\":\"before\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":86,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/Add heading (h1) and code block_1_f09fb671c15594eba4367376e1de7404.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/Add heading (h1) and code block_1_c9d02980acbb81e12922c758580ae086.json similarity index 65% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/Add heading (h1) and code block_1_f09fb671c15594eba4367376e1de7404.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/Add heading (h1) and code block_1_c9d02980acbb81e12922c758580ae086.json index 77e9c9c867..3b5d410a67 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/Add heading (h1) and code block_1_f09fb671c15594eba4367376e1de7404.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/Add heading (h1) and code block_1_c9d02980acbb81e12922c758580ae086.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-c2860c72-bf2c-4fc8-aeba-f90d1d5b3eed\",\"object\":\"chat.completion\",\"created\":1749735013,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"22q145ykc\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003ch1\\\\u003eCode\\\\u003c/h1\\\\u003e\\\",\\\"\\\\u003cpre\\\\u003e\\\\u003ccode data-language=\\\\\\\"javascript\\\\\\\"\\\\u003econsole.log('hello world');\\\\u003c/code\\\\u003e\\\\u003c/pre\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.098036554,\"prompt_tokens\":846,\"prompt_time\":0.054901739,\"completion_tokens\":55,\"completion_time\":0.2,\"total_tokens\":901,\"total_time\":0.254901739},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01jxj5ayhxfyevq2h8cd7byq22\"}}\n", + "body": "{\"id\":\"chatcmpl-16cfca90-d128-48c2-b5f6-d9fe0ad3df83\",\"object\":\"chat.completion\",\"created\":1752130624,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"qw1nkwham\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003ch1\\\\u003eCode\\\\u003c/h1\\\\u003e\\\",\\\"\\\\u003cpre\\\\u003e\\\\u003ccode data-language=\\\\\\\"javascript\\\\\\\"\\\\u003econsole.log('hello world');\\\\u003c/code\\\\u003e\\\\u003c/pre\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.042237388,\"prompt_tokens\":842,\"prompt_time\":0.049498849,\"completion_tokens\":55,\"completion_time\":0.162883412,\"total_tokens\":897,\"total_time\":0.212382261},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshz6msf0ytx6b87m99qma9\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a list (end)_1_9ca128e303da5f76048c82f2c1928b5f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a list (end)_1_898ab571e824bb2cf7bfd3a4ec769cc4.json similarity index 63% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a list (end)_1_9ca128e303da5f76048c82f2c1928b5f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a list (end)_1_898ab571e824bb2cf7bfd3a4ec769cc4.json index ac4fe16067..dd6512844a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a list (end)_1_9ca128e303da5f76048c82f2c1928b5f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a list (end)_1_898ab571e824bb2cf7bfd3a4ec769cc4.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a list with the items 'Apples' and 'Bananas' after the last 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a list with the items 'Apples' and 'Bananas' after the last 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-de38ce51-356f-43d2-ab16-56237affd0f3\",\"object\":\"chat.completion\",\"created\":1749735012,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"78ycvsd8a\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09182320900000002,\"prompt_tokens\":837,\"prompt_time\":0.078260528,\"completion_tokens\":51,\"completion_time\":0.185454545,\"total_tokens\":888,\"total_time\":0.263715073},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01jxj5ay4efdw9tyxk502bp42n\"}}\n", + "body": "{\"id\":\"chatcmpl-e54dc9e2-a4a9-4bbb-b5ff-33a28d75350c\",\"object\":\"chat.completion\",\"created\":1752130909,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"wybbdppy1\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09190603800000001,\"prompt_tokens\":833,\"prompt_time\":0.049916261,\"completion_tokens\":51,\"completion_time\":0.138553258,\"total_tokens\":884,\"total_time\":0.188469519},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_6507bcfb6f\",\"x_groq\":{\"id\":\"req_01jzsj7x8xf48a1fh54n0ax6zc\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (empty doc)_1_fedaaecc10d6ddf733d85168d2167795.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (empty doc)_1_13f4377aac43e7a42d2e0fbe377b093f.json similarity index 61% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (empty doc)_1_fedaaecc10d6ddf733d85168d2167795.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (empty doc)_1_13f4377aac43e7a42d2e0fbe377b093f.json index b3973273ab..e7ad609a9f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (empty doc)_1_fedaaecc10d6ddf733d85168d2167795.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (empty doc)_1_13f4377aac43e7a42d2e0fbe377b093f.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-1fcf8b4d-cd99-49de-98eb-60a5afebbd2c\",\"object\":\"chat.completion\",\"created\":1749735013,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"24xyx2pfn\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09109946699999999,\"prompt_tokens\":806,\"prompt_time\":0.062129547,\"completion_tokens\":29,\"completion_time\":0.105454545,\"total_tokens\":835,\"total_time\":0.167584092},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_6507bcfb6f\",\"x_groq\":{\"id\":\"req_01jxj5ayyhfygvd6f1rc0dfqmp\"}}\n", + "body": "{\"id\":\"chatcmpl-ad75602b-c1f3-483a-a5aa-e2e6b3b4d9bb\",\"object\":\"chat.completion\",\"created\":1752130624,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"94nvtpdqz\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.042809683,\"prompt_tokens\":802,\"prompt_time\":0.047337695,\"completion_tokens\":29,\"completion_time\":0.099039228,\"total_tokens\":831,\"total_time\":0.146376923},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshz6y3fp1rwk5ed2sjcx4q\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (end)_1_fe965ef7a99beb3acc090a9f597b4279.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (end)_1_41b6ad49c80f708e02a289f0a978d10f.json similarity index 62% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (end)_1_fe965ef7a99beb3acc090a9f597b4279.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (end)_1_41b6ad49c80f708e02a289f0a978d10f.json index 458499f712..3a728b7a42 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (end)_1_fe965ef7a99beb3acc090a9f597b4279.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (end)_1_41b6ad49c80f708e02a289f0a978d10f.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the last 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the last 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-d4a27071-529d-40ea-b121-7aa202f0de46\",\"object\":\"chat.completion\",\"created\":1749735012,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"gh75jer5b\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09238692300000001,\"prompt_tokens\":835,\"prompt_time\":0.061191316,\"completion_tokens\":35,\"completion_time\":0.127272727,\"total_tokens\":870,\"total_time\":0.188464043},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01jxj5axsse8a86ce6fe3rca22\"}}\n", + "body": "{\"id\":\"chatcmpl-34630786-57bb-4694-9d3e-8c912bb679fd\",\"object\":\"chat.completion\",\"created\":1752130623,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"09tvbsnpk\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.042127442,\"prompt_tokens\":831,\"prompt_time\":0.049212743,\"completion_tokens\":35,\"completion_time\":0.099759689,\"total_tokens\":866,\"total_time\":0.148972432},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshz62gf0yssptpzy3davx4\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (start)_1_232100784a2397a470c08d82001cb7fb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (start)_1_ba9d1b82c2e1653cbfad19e72d157d19.json similarity index 62% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (start)_1_232100784a2397a470c08d82001cb7fb.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (start)_1_ba9d1b82c2e1653cbfad19e72d157d19.json index be7fce3ef0..9cc249ec7b 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (start)_1_232100784a2397a470c08d82001cb7fb.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (start)_1_ba9d1b82c2e1653cbfad19e72d157d19.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-526e8aaa-c021-4219-94d3-e716b215b01a\",\"object\":\"chat.completion\",\"created\":1749735011,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"k88tbqp9f\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.091399001,\"prompt_tokens\":835,\"prompt_time\":0.065172628,\"completion_tokens\":35,\"completion_time\":0.174045963,\"total_tokens\":870,\"total_time\":0.239218591},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01jxj5axcpfdta36yqazhrbrgr\"}}\n", + "body": "{\"id\":\"chatcmpl-7c52e0a4-3f95-437b-8bda-f0bc3717facd\",\"object\":\"chat.completion\",\"created\":1752130623,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"t5n1ry85y\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.047868787,\"prompt_tokens\":831,\"prompt_time\":0.048984726,\"completion_tokens\":42,\"completion_time\":0.155879323,\"total_tokens\":873,\"total_time\":0.204864049},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshz5ntfp0th8nj8f3mmw8t\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_da4995473884c05440ca118c6ae41453.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_d7a1ca07ded19de08a51f21236c2d68e.json similarity index 58% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_da4995473884c05440ca118c6ae41453.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_d7a1ca07ded19de08a51f21236c2d68e.json index 8ceead3e82..67d8062032 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_da4995473884c05440ca118c6ae41453.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_d7a1ca07ded19de08a51f21236c2d68e.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-72548951-766a-4018-ba35-a251b39e732d\",\"object\":\"chat.completion.chunk\",\"created\":1749735002,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jxj5amjje6yv7160wmb7q5mx\"}}\n\ndata: {\"id\":\"chatcmpl-72548951-766a-4018-ba35-a251b39e732d\",\"object\":\"chat.completion.chunk\",\"created\":1749735003,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"hprz8hk3c\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003ch1\\\\u003eCode\\\\u003c/h1\\\\u003e\\\",\\\"\\\\u003cpre\\\\u003e\\\\u003ccode data-language=\\\\\\\"javascript\\\\\\\"\\\\u003econsole.log('hello world');\\\\u003c/code\\\\u003e\\\\u003c/pre\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-72548951-766a-4018-ba35-a251b39e732d\",\"object\":\"chat.completion.chunk\",\"created\":1749735003,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5amjje6yv7160wmb7q5mx\",\"usage\":{\"queue_time\":0.09459606400000001,\"prompt_tokens\":846,\"prompt_time\":0.064866899,\"completion_tokens\":55,\"completion_time\":0.2,\"total_tokens\":901,\"total_time\":0.264866899}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-8121ad5c-58ab-4237-aa20-5d20398cc22c\",\"object\":\"chat.completion.chunk\",\"created\":1752130616,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshyzf6fnxvkgnesn8dw2ww\"}}\n\ndata: {\"id\":\"chatcmpl-8121ad5c-58ab-4237-aa20-5d20398cc22c\",\"object\":\"chat.completion.chunk\",\"created\":1752130617,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"4gtdpmvgt\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003ch1\\\\u003eCode\\\\u003c/h1\\\\u003e\\\",\\\"\\\\u003cpre\\\\u003e\\\\u003ccode data-language=\\\\\\\"javascript\\\\\\\"\\\\u003econsole.log('hello world');\\\\u003c/code\\\\u003e\\\\u003c/pre\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-8121ad5c-58ab-4237-aa20-5d20398cc22c\",\"object\":\"chat.completion.chunk\",\"created\":1752130617,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshyzf6fnxvkgnesn8dw2ww\",\"usage\":{\"queue_time\":0.042341224,\"prompt_tokens\":842,\"prompt_time\":0.049594108,\"completion_tokens\":55,\"completion_time\":0.161668326,\"total_tokens\":897,\"total_time\":0.211262434}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_bcc7319416c9b14368ea5ad861f9b722.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_ea8fe6c45678a567e7bfc9a4f9ff9d7e.json similarity index 57% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_bcc7319416c9b14368ea5ad861f9b722.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_ea8fe6c45678a567e7bfc9a4f9ff9d7e.json index 7c30bb39ac..5c77355a1f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_bcc7319416c9b14368ea5ad861f9b722.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_ea8fe6c45678a567e7bfc9a4f9ff9d7e.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a list with the items 'Apples' and 'Bananas' after the last 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a list with the items 'Apples' and 'Bananas' after the last 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-aaec325d-3a73-4a40-ae7a-1d7a6e2e2778\",\"object\":\"chat.completion.chunk\",\"created\":1749735002,\"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_01jxj5am66fxmv61kd5fp0avm6\"}}\n\ndata: {\"id\":\"chatcmpl-aaec325d-3a73-4a40-ae7a-1d7a6e2e2778\",\"object\":\"chat.completion.chunk\",\"created\":1749735002,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"n75ngk650\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-aaec325d-3a73-4a40-ae7a-1d7a6e2e2778\",\"object\":\"chat.completion.chunk\",\"created\":1749735002,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5am66fxmv61kd5fp0avm6\",\"usage\":{\"queue_time\":0.106533102,\"prompt_tokens\":837,\"prompt_time\":0.054820783,\"completion_tokens\":51,\"completion_time\":0.185454545,\"total_tokens\":888,\"total_time\":0.240275328}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-4b2eafa2-c537-4f61-ac04-db0f725bdd53\",\"object\":\"chat.completion.chunk\",\"created\":1752130616,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshyz60f0wbzdqx2pqhehh7\"}}\n\ndata: {\"id\":\"chatcmpl-4b2eafa2-c537-4f61-ac04-db0f725bdd53\",\"object\":\"chat.completion.chunk\",\"created\":1752130616,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"mt200e4ye\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-4b2eafa2-c537-4f61-ac04-db0f725bdd53\",\"object\":\"chat.completion.chunk\",\"created\":1752130616,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshyz60f0wbzdqx2pqhehh7\",\"usage\":{\"queue_time\":0.04321056399999999,\"prompt_tokens\":833,\"prompt_time\":0.049187463,\"completion_tokens\":51,\"completion_time\":0.146778037,\"total_tokens\":884,\"total_time\":0.1959655}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_8fd66df698028c81b94d9c3da3f48565.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_be406ee8435789d49b4de3a2952366bc.json similarity index 54% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_8fd66df698028c81b94d9c3da3f48565.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_be406ee8435789d49b4de3a2952366bc.json index b97582dd1e..b09bc6d087 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_8fd66df698028c81b94d9c3da3f48565.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_be406ee8435789d49b4de3a2952366bc.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-6934a8ab-ea7d-455c-9385-777a43dc1dea\",\"object\":\"chat.completion.chunk\",\"created\":1749735003,\"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_01jxj5amzgfd2vg0vxqbx0xpvj\"}}\n\ndata: {\"id\":\"chatcmpl-6934a8ab-ea7d-455c-9385-777a43dc1dea\",\"object\":\"chat.completion.chunk\",\"created\":1749735003,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"4nwdc3smg\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-6934a8ab-ea7d-455c-9385-777a43dc1dea\",\"object\":\"chat.completion.chunk\",\"created\":1749735003,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5amzgfd2vg0vxqbx0xpvj\",\"usage\":{\"queue_time\":0.099784388,\"prompt_tokens\":806,\"prompt_time\":0.089811677,\"completion_tokens\":29,\"completion_time\":0.112542101,\"total_tokens\":835,\"total_time\":0.202353778}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-e6d696e2-27f4-43f6-88dc-f28089b0d7fc\",\"object\":\"chat.completion.chunk\",\"created\":1752130617,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshyzrnf0wvt22hcztyza7d\"}}\n\ndata: {\"id\":\"chatcmpl-e6d696e2-27f4-43f6-88dc-f28089b0d7fc\",\"object\":\"chat.completion.chunk\",\"created\":1752130617,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"t7jvh4gyt\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-e6d696e2-27f4-43f6-88dc-f28089b0d7fc\",\"object\":\"chat.completion.chunk\",\"created\":1752130617,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshyzrnf0wvt22hcztyza7d\",\"usage\":{\"queue_time\":0.042045861,\"prompt_tokens\":802,\"prompt_time\":0.047866258,\"completion_tokens\":29,\"completion_time\":0.101242732,\"total_tokens\":831,\"total_time\":0.14910899}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_1df9f2bee04498ef092f332ebce02289.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_0f618344844192bfd9fca2e00cb8ef3a.json similarity index 56% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_1df9f2bee04498ef092f332ebce02289.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_0f618344844192bfd9fca2e00cb8ef3a.json index 3586f59f35..6be8a29802 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_1df9f2bee04498ef092f332ebce02289.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_0f618344844192bfd9fca2e00cb8ef3a.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the last 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the last 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-369069e3-6b5f-418b-a117-2cdd68413046\",\"object\":\"chat.completion.chunk\",\"created\":1749735002,\"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_01jxj5akvnfd0vvs7cg18wspc3\"}}\n\ndata: {\"id\":\"chatcmpl-369069e3-6b5f-418b-a117-2cdd68413046\",\"object\":\"chat.completion.chunk\",\"created\":1749735002,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"91b39mskf\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-369069e3-6b5f-418b-a117-2cdd68413046\",\"object\":\"chat.completion.chunk\",\"created\":1749735002,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5akvnfd0vvs7cg18wspc3\",\"usage\":{\"queue_time\":0.092571143,\"prompt_tokens\":835,\"prompt_time\":0.060993447,\"completion_tokens\":35,\"completion_time\":0.127272727,\"total_tokens\":870,\"total_time\":0.188266174}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-80ab2ad0-05bb-4a03-89b0-4e7ece19cef3\",\"object\":\"chat.completion.chunk\",\"created\":1752130616,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshyyyvfnxtk7xre674ej1e\"}}\n\ndata: {\"id\":\"chatcmpl-80ab2ad0-05bb-4a03-89b0-4e7ece19cef3\",\"object\":\"chat.completion.chunk\",\"created\":1752130616,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"sye76t0vy\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-80ab2ad0-05bb-4a03-89b0-4e7ece19cef3\",\"object\":\"chat.completion.chunk\",\"created\":1752130616,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshyyyvfnxtk7xre674ej1e\",\"usage\":{\"queue_time\":0.042117695999999996,\"prompt_tokens\":831,\"prompt_time\":0.056195282,\"completion_tokens\":35,\"completion_time\":0.08327463,\"total_tokens\":866,\"total_time\":0.139469912}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_ddea32bf65559924075cf5a378ff52a9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_a171c162d38c9ae40b2a22be3ef913b9.json similarity index 56% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_ddea32bf65559924075cf5a378ff52a9.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_a171c162d38c9ae40b2a22be3ef913b9.json index ba3e6bda43..a5f6fb8833 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_ddea32bf65559924075cf5a378ff52a9.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_a171c162d38c9ae40b2a22be3ef913b9.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-51f1dbd8-3053-4621-ba30-4fae667beaa2\",\"object\":\"chat.completion.chunk\",\"created\":1749735001,\"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_01jxj5akfre6tt924djjqwves4\"}}\n\ndata: {\"id\":\"chatcmpl-51f1dbd8-3053-4621-ba30-4fae667beaa2\",\"object\":\"chat.completion.chunk\",\"created\":1749735001,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"ckhkh5yhs\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-51f1dbd8-3053-4621-ba30-4fae667beaa2\",\"object\":\"chat.completion.chunk\",\"created\":1749735001,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5akfre6tt924djjqwves4\",\"usage\":{\"queue_time\":0.09118687499999999,\"prompt_tokens\":835,\"prompt_time\":0.061023436,\"completion_tokens\":35,\"completion_time\":0.14557445,\"total_tokens\":870,\"total_time\":0.206597886}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-a1ee91f9-8c7d-4636-bcd4-bd95ed9f17c4\",\"object\":\"chat.completion.chunk\",\"created\":1752130908,\"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_01jzsj7wchf6tsa3qr467dr0yw\"}}\n\ndata: {\"id\":\"chatcmpl-a1ee91f9-8c7d-4636-bcd4-bd95ed9f17c4\",\"object\":\"chat.completion.chunk\",\"created\":1752130908,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"hqfdzbw2q\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-a1ee91f9-8c7d-4636-bcd4-bd95ed9f17c4\",\"object\":\"chat.completion.chunk\",\"created\":1752130908,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzsj7wchf6tsa3qr467dr0yw\",\"usage\":{\"queue_time\":0.09993144100000001,\"prompt_tokens\":831,\"prompt_time\":0.050442245,\"completion_tokens\":42,\"completion_time\":0.139755054,\"total_tokens\":873,\"total_time\":0.190197299}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_411b9303baf0445a2b3d22af986dcbd7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_4490bc6c485a737b4584207976c00303.json similarity index 71% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_411b9303baf0445a2b3d22af986dcbd7.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_4490bc6c485a737b4584207976c00303.json index 19c00931aa..ff31cb607e 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_411b9303baf0445a2b3d22af986dcbd7.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_4490bc6c485a737b4584207976c00303.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHcXzLav5y527uW3UhvSJD9dTeo\",\n \"object\": \"chat.completion\",\n \"created\": 1749734964,\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_HMrcqJl2U48muUM9mKVoEx89\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('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\": 568,\n \"completion_tokens\": 54,\n \"total_tokens\": 622,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfUnLTGBpQcxcCoSsSsHKbgMAQfa\",\n \"object\": \"chat.completion\",\n \"created\": 1752130593,\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_CCvkCb0sAJsSvPuxhF1xYnKa\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('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\": 568,\n \"completion_tokens\": 54,\n \"total_tokens\": 622,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_b62f9dcc3af6272c847eb867f28464e4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_7a96610c4bbc6c8f141e4addbc2106bf.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_b62f9dcc3af6272c847eb867f28464e4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_7a96610c4bbc6c8f141e4addbc2106bf.json index 22ed35bdc0..10f6c7ba57 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_b62f9dcc3af6272c847eb867f28464e4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_7a96610c4bbc6c8f141e4addbc2106bf.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a list with the items 'Apples' and 'Bananas' after the last 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a list with the items 'Apples' and 'Bananas' after the last 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHaJoVYMoMrMC30NpH85UeenBhz\",\n \"object\": \"chat.completion\",\n \"created\": 1749734962,\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_vVBHxWaXXZikr4jlgeBC3QvE\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"\\\",\\\"\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 559,\n \"completion_tokens\": 49,\n \"total_tokens\": 608,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfUlLn4x4YnfMjUqjKmgPWuKunwK\",\n \"object\": \"chat.completion\",\n \"created\": 1752130591,\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_lQulQ4tdoQq8TWOXiQ31wyzo\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"\\\",\\\"\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 559,\n \"completion_tokens\": 49,\n \"total_tokens\": 608,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_e3538aed67ed181c709f2c76ebd3b88c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_44de7bf7410dad3111bbadfa384b3806.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_e3538aed67ed181c709f2c76ebd3b88c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_44de7bf7410dad3111bbadfa384b3806.json index c333c9aab7..76e7bf09e9 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_e3538aed67ed181c709f2c76ebd3b88c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_44de7bf7410dad3111bbadfa384b3806.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHeBLwNNR7ntGdzeAY52DxK4ymC\",\n \"object\": \"chat.completion\",\n \"created\": 1749734966,\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_kpodB0YgskXJbNi9zXuzVapO\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 529,\n \"completion_tokens\": 27,\n \"total_tokens\": 556,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfUoO1JMa4AqmsxmvD3Bars5dREW\",\n \"object\": \"chat.completion\",\n \"created\": 1752130594,\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_PK4k7Q7wb5cjD6fDWRncZFwD\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 529,\n \"completion_tokens\": 27,\n \"total_tokens\": 556,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_4da2dc377fad46f51e531f5cb2594b48.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_b6706fca4145b801d7884d53dd16458f.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_4da2dc377fad46f51e531f5cb2594b48.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_b6706fca4145b801d7884d53dd16458f.json index da55fabeb6..606d1f27c8 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_4da2dc377fad46f51e531f5cb2594b48.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_b6706fca4145b801d7884d53dd16458f.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the last 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the last 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHZThDBiAbblf8hHnPXcot6f7Uo\",\n \"object\": \"chat.completion\",\n \"created\": 1749734961,\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_WN68RZCd97USYTUoxTScDSr4\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 557,\n \"completion_tokens\": 33,\n \"total_tokens\": 590,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfUlpLL0cPUet25oQhj68M4pB39e\",\n \"object\": \"chat.completion\",\n \"created\": 1752130591,\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_vM5ekVAWSXz9CqW6XeEaDFoh\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 557,\n \"completion_tokens\": 33,\n \"total_tokens\": 590,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_9a1739085965869c82a4ab025a9b426c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_f2e4502c4c5fb89e3ab56801c4e2ebb1.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_9a1739085965869c82a4ab025a9b426c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_f2e4502c4c5fb89e3ab56801c4e2ebb1.json index f4d51883ad..0e2fb13213 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_9a1739085965869c82a4ab025a9b426c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_f2e4502c4c5fb89e3ab56801c4e2ebb1.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHXwZHLPKTGgETcmuOadPrjjciV\",\n \"object\": \"chat.completion\",\n \"created\": 1749734959,\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_bwEScmPOyhi63oPVn60iCfsZ\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 557,\n \"completion_tokens\": 33,\n \"total_tokens\": 590,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfUkWvUrVkpEWKC0VHlMlv5HRcDZ\",\n \"object\": \"chat.completion\",\n \"created\": 1752130590,\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_DrSnxyTsc9u03fd2USYFe4ZY\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 557,\n \"completion_tokens\": 33,\n \"total_tokens\": 590,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_91d754a12d792f37fe1483d19a7b4e64.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_91d754a12d792f37fe1483d19a7b4e64.json deleted file mode 100644 index f15b1587bd..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_91d754a12d792f37fe1483d19a7b4e64.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_6OdZVacjfv8FzU7hTBA7a1LT\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Code\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"pre\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"code\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-language\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"javascript\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"console\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".log\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"('\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"');\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGkPvyD6TOzq8n1OsFShY4AJVKy\",\"object\":\"chat.completion.chunk\",\"created\":1749734910,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_bde67ab7834e0e85453474bfec5d6899.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_bde67ab7834e0e85453474bfec5d6899.json new file mode 100644 index 0000000000..b0ef6a7a78 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_bde67ab7834e0e85453474bfec5d6899.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_TzKTg1nqEppHpsSWqmRCuwtx\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Code\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"pre\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"code\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-language\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"javascript\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"console\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".log\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"('\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"');\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUGAcRYQxVILik2EDgpEUGQvnZi\",\"object\":\"chat.completion.chunk\",\"created\":1752130560,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_1b9c5367195624176c28a1ca3684ebac.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_1b9c5367195624176c28a1ca3684ebac.json deleted file mode 100644 index 0eeaac13a5..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_1b9c5367195624176c28a1ca3684ebac.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a list with the items 'Apples' and 'Bananas' after the last 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_aOOYXTtpsFfao3uqi9432RDF\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ap\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ples\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ban\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"anas\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGi3eL7LDLXmNgxdS2BCXCkmDEf\",\"object\":\"chat.completion.chunk\",\"created\":1749734908,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_87f55153eeb60ab71bfc14cc2fd2f957.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_87f55153eeb60ab71bfc14cc2fd2f957.json new file mode 100644 index 0000000000..251b1ea93c --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_87f55153eeb60ab71bfc14cc2fd2f957.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a list with the items 'Apples' and 'Bananas' after the last 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_EhrtnUT2DmxE6EVrmBJzRWfZ\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ap\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ples\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ban\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"anas\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUEzCirYhzRPzdzdOkMrFG0cLmY\",\"object\":\"chat.completion.chunk\",\"created\":1752130558,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_51ba760ef2fb18f3445641c82a09fabc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_51ba760ef2fb18f3445641c82a09fabc.json new file mode 100644 index 0000000000..aa6e00d86e --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_51ba760ef2fb18f3445641c82a09fabc.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_cS0DyHNV0I7rS0cqgOSsK7Lj\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUJewaZnEsNEEtQg0cZe9f7hknH\",\"object\":\"chat.completion.chunk\",\"created\":1752130563,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_bda56d4903fe73aa33304a959057957d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_bda56d4903fe73aa33304a959057957d.json deleted file mode 100644 index 9ed6be798a..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_bda56d4903fe73aa33304a959057957d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_HS7IYn8XUwWzAFzkS9fgsQ8N\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGmLLmNUQuO9oP5nEoolsBcpYWj\",\"object\":\"chat.completion.chunk\",\"created\":1749734912,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_731edbb5fc3b6e4a927978b9e203f336.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_731edbb5fc3b6e4a927978b9e203f336.json deleted file mode 100644 index 0fb54fdb96..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_731edbb5fc3b6e4a927978b9e203f336.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the last 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_C1yHXWY86n85130YVLYbGjnf\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGhb5lWmFs3Y4RYpLW3sw9aEepC\",\"object\":\"chat.completion.chunk\",\"created\":1749734907,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_8e7994f92b21645243d6012cbefb10aa.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_8e7994f92b21645243d6012cbefb10aa.json new file mode 100644 index 0000000000..d5919db18b --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_8e7994f92b21645243d6012cbefb10aa.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the last 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_FMxEJofTkTCNFXREt26DTVZ6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUDE09cPpggfCJUgEyORsccraik\",\"object\":\"chat.completion.chunk\",\"created\":1752130557,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_13e966493243f338888f862532e11055.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_13e966493243f338888f862532e11055.json new file mode 100644 index 0000000000..b18f6f502f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_13e966493243f338888f862532e11055.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_3iyoEqLsLtq7g0dM0grk8Soo\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"before\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfafuHVrPmvUg8XTnndfCSCJIHrz\",\"object\":\"chat.completion.chunk\",\"created\":1752130957,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_56f9b395b16c8dc222ce13deb68cd412.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_56f9b395b16c8dc222ce13deb68cd412.json deleted file mode 100644 index 35597eb08a..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_56f9b395b16c8dc222ce13deb68cd412.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_ipCKvBqGd30oP5MRdmPSHOt0\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"before\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGexhSaSWTDmxY9Dd4iUZkHjleg\",\"object\":\"chat.completion.chunk\",\"created\":1749734904,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_a16755b57abd9123bc8d138ece2fc206.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_a6c32f94ed9ef180b605d3e529b66f0a.json similarity index 71% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_a16755b57abd9123bc8d138ece2fc206.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_a6c32f94ed9ef180b605d3e529b66f0a.json index d79f6a3386..f9cc5b567c 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_a16755b57abd9123bc8d138ece2fc206.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_a6c32f94ed9ef180b605d3e529b66f0a.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01RsZ4QfScCQwSwXM3Wk2PfP\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01DSe9Lc3XCXRWDU49uGB3xP\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hallo, wereld!

\"},{\"type\":\"add\",\"referenceId\":\"ref1$\",\"position\":\"after\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":127,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01MudmbhQcmgt2Srbh9a4wAV\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01JkSQMegjECVARaMfkywGZW\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hallo, wereld!

\"},{\"type\":\"add\",\"referenceId\":\"ref1$\",\"position\":\"after\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1246,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":127,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_9d3466520f605a356f2c31458954e816.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_da1b9a436aabf66b488fd5f147c006d6.json similarity index 65% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_9d3466520f605a356f2c31458954e816.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_da1b9a436aabf66b488fd5f147c006d6.json index a27e6af334..facd5abf2a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_9d3466520f605a356f2c31458954e816.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_da1b9a436aabf66b488fd5f147c006d6.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01WNGZ4AgjecSeF4a64wKvaA\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01ATgVa6VrWee4M1tTRDDog7\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"before\",\"blocks\":[\"

You look great today!

\"]},{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1078,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":124,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_019j78Z3Z14ssqJ5rAEPwkb3\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01J58YAgFbrb24guRXpqXHA2\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"before\",\"blocks\":[\"

You look great today!

\"]},{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1069,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":124,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add and update paragraph_1_051b564433dad882d26853a2d2e41841.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add and update paragraph_1_b747e1a9db81d87169dbb057c80a400e.json similarity index 67% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add and update paragraph_1_051b564433dad882d26853a2d2e41841.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add and update paragraph_1_b747e1a9db81d87169dbb057c80a400e.json index 92b3343179..718e000a49 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add and update paragraph_1_051b564433dad882d26853a2d2e41841.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add and update paragraph_1_b747e1a9db81d87169dbb057c80a400e.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-4fcb1519-dbc4-4471-b76b-5294aaac32f4\",\"object\":\"chat.completion\",\"created\":1749735020,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"rtqvvxcb0\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, wereld!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.091253663,\"prompt_tokens\":940,\"prompt_time\":0.067942148,\"completion_tokens\":57,\"completion_time\":0.224358045,\"total_tokens\":997,\"total_time\":0.292300193},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01jxj5b64we8m83ajdptwswp7v\"}}\n", + "body": "{\"id\":\"chatcmpl-59923e35-d0ca-418d-9a08-1d32c8f3885f\",\"object\":\"chat.completion\",\"created\":1752130629,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"7ts81h8ja\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, wereld!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.042815677999999996,\"prompt_tokens\":936,\"prompt_time\":0.055299133,\"completion_tokens\":57,\"completion_time\":0.14391112,\"total_tokens\":993,\"total_time\":0.199210253},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshzc70f10sxw9p15hth9h7\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add paragraph and update selection_1_0ca431ee9c56812e10198e60552a536f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add paragraph and update selection_1_1441637b8dce16dc9c48df2cf6507d9b.json similarity index 61% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add paragraph and update selection_1_0ca431ee9c56812e10198e60552a536f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add paragraph and update selection_1_1441637b8dce16dc9c48df2cf6507d9b.json index 1a4e0a7734..21030ebbbe 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add paragraph and update selection_1_0ca431ee9c56812e10198e60552a536f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add paragraph and update selection_1_1441637b8dce16dc9c48df2cf6507d9b.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-d6430160-0551-44b1-84be-25dc5afcdc00\",\"object\":\"chat.completion\",\"created\":1749735021,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"x1khw2t17\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.092257842,\"prompt_tokens\":777,\"prompt_time\":0.06067714,\"completion_tokens\":66,\"completion_time\":0.24,\"total_tokens\":843,\"total_time\":0.30067714},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01jxj5b6jne8mrn0m5fzzwjm4j\"}}\n", + "body": "{\"id\":\"chatcmpl-b8fcce0a-446d-4881-9ab5-92ff52720367\",\"object\":\"chat.completion\",\"created\":1752130630,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"spmvdw9sg\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.049045728,\"prompt_tokens\":773,\"prompt_time\":0.047097157,\"completion_tokens\":67,\"completion_time\":0.182757312,\"total_tokens\":840,\"total_time\":0.229854469},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshzcj8fp4raxta0mendv1h\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_8ef78aa1880fd8536fa49acb127f51c0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_7252c232ad6e528961ee8cb6825e1ced.json similarity index 61% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_8ef78aa1880fd8536fa49acb127f51c0.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_7252c232ad6e528961ee8cb6825e1ced.json index b65d896c88..0dd922cce3 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_8ef78aa1880fd8536fa49acb127f51c0.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_7252c232ad6e528961ee8cb6825e1ced.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-6e2d5c43-6a50-47c3-9645-7f5d5963334f\",\"object\":\"chat.completion.chunk\",\"created\":1749735010,\"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_01jxj5awfye88v3wh6v8hy10nb\"}}\n\ndata: {\"id\":\"chatcmpl-6e2d5c43-6a50-47c3-9645-7f5d5963334f\",\"object\":\"chat.completion.chunk\",\"created\":1749735011,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"7dhghssm3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, wereld!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-6e2d5c43-6a50-47c3-9645-7f5d5963334f\",\"object\":\"chat.completion.chunk\",\"created\":1749735011,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5awfye88v3wh6v8hy10nb\",\"usage\":{\"queue_time\":0.092593678,\"prompt_tokens\":940,\"prompt_time\":0.067451622,\"completion_tokens\":57,\"completion_time\":0.249589908,\"total_tokens\":997,\"total_time\":0.31704153}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-0847e0f9-3566-4765-8412-cf1c9979d21b\",\"object\":\"chat.completion.chunk\",\"created\":1752130622,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz503fp0bfxce09b3ry88\"}}\n\ndata: {\"id\":\"chatcmpl-0847e0f9-3566-4765-8412-cf1c9979d21b\",\"object\":\"chat.completion.chunk\",\"created\":1752130622,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"24y41e2n7\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, wereld!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-0847e0f9-3566-4765-8412-cf1c9979d21b\",\"object\":\"chat.completion.chunk\",\"created\":1752130622,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz503fp0bfxce09b3ry88\",\"usage\":{\"queue_time\":0.043057955,\"prompt_tokens\":936,\"prompt_time\":0.054746788,\"completion_tokens\":57,\"completion_time\":0.156278908,\"total_tokens\":993,\"total_time\":0.211025696}}}\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/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_04f9e76ff73eff953288564e5385dbd4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_ce0574730306ae367b09cefba52e1ee5.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_04f9e76ff73eff953288564e5385dbd4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_ce0574730306ae367b09cefba52e1ee5.json index 8a4b28a8a5..f46016c81a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_04f9e76ff73eff953288564e5385dbd4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_ce0574730306ae367b09cefba52e1ee5.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-da63bfac-dc24-4950-95aa-cf33e51d8f7c\",\"object\":\"chat.completion.chunk\",\"created\":1749735011,\"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_01jxj5awyffyctg2cg8jyf1x7q\"}}\n\ndata: {\"id\":\"chatcmpl-da63bfac-dc24-4950-95aa-cf33e51d8f7c\",\"object\":\"chat.completion.chunk\",\"created\":1749735011,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"qxzewbkcj\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-da63bfac-dc24-4950-95aa-cf33e51d8f7c\",\"object\":\"chat.completion.chunk\",\"created\":1749735011,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5awyffyctg2cg8jyf1x7q\",\"usage\":{\"queue_time\":0.091723215,\"prompt_tokens\":777,\"prompt_time\":0.061640002,\"completion_tokens\":66,\"completion_time\":0.24,\"total_tokens\":843,\"total_time\":0.301640002}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-cb8dcfd6-7994-4948-82bc-11b863c77040\",\"object\":\"chat.completion.chunk\",\"created\":1752130622,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz59bf0yv2cnwwwkp6yxk\"}}\n\ndata: {\"id\":\"chatcmpl-cb8dcfd6-7994-4948-82bc-11b863c77040\",\"object\":\"chat.completion.chunk\",\"created\":1752130623,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"3g0m2q1nc\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-cb8dcfd6-7994-4948-82bc-11b863c77040\",\"object\":\"chat.completion.chunk\",\"created\":1752130623,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz59bf0yv2cnwwwkp6yxk\",\"usage\":{\"queue_time\":0.045599708,\"prompt_tokens\":773,\"prompt_time\":0.046639812,\"completion_tokens\":67,\"completion_time\":0.172812717,\"total_tokens\":840,\"total_time\":0.219452529}}}\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/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_e9e8ca04b228ebbec6f48d24c147fbcf.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_304d3249edb4213cd5b98862492557f2.json similarity index 73% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_e9e8ca04b228ebbec6f48d24c147fbcf.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_304d3249edb4213cd5b98862492557f2.json index 458604ebe0..89f94f4738 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_e9e8ca04b228ebbec6f48d24c147fbcf.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_304d3249edb4213cd5b98862492557f2.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcI4YClPDOLlQWC0xY3pVFCPUvCz\",\n \"object\": \"chat.completion\",\n \"created\": 1749734992,\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_bmqsuC0QzwcY2QEFzV3ORrxp\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 662,\n \"completion_tokens\": 55,\n \"total_tokens\": 717,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfV7knlc4y7Mkc32oMekSv8XFG3c\",\n \"object\": \"chat.completion\",\n \"created\": 1752130613,\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_AfCz0QUXkRLq9FVZxl0a6w6v\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 662,\n \"completion_tokens\": 55,\n \"total_tokens\": 717,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_f5cd402d603bead3d759ebb5485f39c3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_58bb195c54dff663752ffdd8e6b50bf0.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_f5cd402d603bead3d759ebb5485f39c3.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_58bb195c54dff663752ffdd8e6b50bf0.json index de2671673e..d9bd852be2 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_f5cd402d603bead3d759ebb5485f39c3.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_58bb195c54dff663752ffdd8e6b50bf0.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcI6p4L0WnWOsSyn0713fUYzN5GQ\",\n \"object\": \"chat.completion\",\n \"created\": 1749734994,\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_xDb7mcgCWRrNwwvaIc0YtmhP\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 503,\n \"completion_tokens\": 53,\n \"total_tokens\": 556,\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_a288987b44\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfV8lRQbKXwOcxFfKSUZXYilZVa4\",\n \"object\": \"chat.completion\",\n \"created\": 1752130614,\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_n4TQAcEJpH52Zu20AYyhtfSp\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 503,\n \"completion_tokens\": 53,\n \"total_tokens\": 556,\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_07871e2ad8\"\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_2551adfcc4ecd63e37094152b44c1144.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_2551adfcc4ecd63e37094152b44c1144.json deleted file mode 100644 index 4ef0cb9c6d..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_2551adfcc4ecd63e37094152b44c1144.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_O0SaEr1CJ3QLiOVAcZyiLRz3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" wereld\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHHR9HYiApLtZ0W01Zj46tEAN8y\",\"object\":\"chat.completion.chunk\",\"created\":1749734943,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"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/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_f7403010a908af399a5228468b304f47.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_f7403010a908af399a5228468b304f47.json new file mode 100644 index 0000000000..44143b905b --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_f7403010a908af399a5228468b304f47.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_3yt8MPEwZsSPSXf66pWeipvx\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" wereld\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZq1uiR8dWGAE5PCA2aKR59udjX\",\"object\":\"chat.completion.chunk\",\"created\":1752130906,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_495ea67d9ad44b58172da3db145b3a10.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_495ea67d9ad44b58172da3db145b3a10.json new file mode 100644 index 0000000000..15f152899d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_495ea67d9ad44b58172da3db145b3a10.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 selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_WlNJzG1hbzzkKftKBmZv9ujL\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"before\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_fc5837fa3ab53d1a511a8092a926d87d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_fc5837fa3ab53d1a511a8092a926d87d.json deleted file mode 100644 index 1cecce8e43..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_fc5837fa3ab53d1a511a8092a926d87d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_Kobbu7ZlwKWFLOQYYFs095gf\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"before\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHIrg4KoEtwph34DcI8WJSGVCWh\",\"object\":\"chat.completion.chunk\",\"created\":1749734944,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"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__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_a4ec61146ba0a517742770cb5843201f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_278e7fb63bd96fb65d7e2b2a6c215e24.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_a4ec61146ba0a517742770cb5843201f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_278e7fb63bd96fb65d7e2b2a6c215e24.json index 26858312be..a4400900a0 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_a4ec61146ba0a517742770cb5843201f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_278e7fb63bd96fb65d7e2b2a6c215e24.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01SjFaJWfvZLCMvS9DRUfauD\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01XrGGTcuKsJqcWuQAJLCrjF\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"delete\",\"id\":\"ref1$\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1231,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":59,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_019uxgeSYfbjvHjwTb9EocrT\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01DQNKXofta88erh1QC3g96L\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"delete\",\"id\":\"ref1$\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1222,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":59,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/delete first block_1_ee24300ba2c8986f54c02b0d2aec9691.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)/delete first block_1_b8070bd231a475d9df5bbb9da081cf01.json similarity index 63% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/delete first block_1_ee24300ba2c8986f54c02b0d2aec9691.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/delete first block_1_b8070bd231a475d9df5bbb9da081cf01.json index 8a1e6ea9f0..01e1e64d8f 100644 --- 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)/delete first block_1_ee24300ba2c8986f54c02b0d2aec9691.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)/delete first block_1_b8070bd231a475d9df5bbb9da081cf01.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"delete 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"delete 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-754c6712-6c24-476f-8527-66acac333674\",\"object\":\"chat.completion\",\"created\":1749735020,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"n5b2r9r2n\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"delete\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09174304000000001,\"prompt_tokens\":917,\"prompt_time\":0.066455909,\"completion_tokens\":17,\"completion_time\":0.062652816,\"total_tokens\":934,\"total_time\":0.129108725},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01jxj5b5wme8kvg34zv9vty9t8\"}}\n", + "body": "{\"id\":\"chatcmpl-cc66b269-af75-41a2-8e4f-5bb6f48060e9\",\"object\":\"chat.completion\",\"created\":1752130629,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"bnw1amq09\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"delete\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.04206301999999999,\"prompt_tokens\":913,\"prompt_time\":0.058731983,\"completion_tokens\":21,\"completion_time\":0.089020913,\"total_tokens\":934,\"total_time\":0.147752896},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshzbzsfp4avcegez79sj0h\"}}\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)/delete first block_1_21ad45e4791e6ce60e52c20228c507ff.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_5190aca5ac8dc8a51ad5b5ab8277fc21.json similarity index 58% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_21ad45e4791e6ce60e52c20228c507ff.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_5190aca5ac8dc8a51ad5b5ab8277fc21.json index f65ea536f5..b44866b822 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_21ad45e4791e6ce60e52c20228c507ff.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_5190aca5ac8dc8a51ad5b5ab8277fc21.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"delete 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"delete 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-a89b0207-c3a0-4bf7-9405-f766a88e1c0e\",\"object\":\"chat.completion.chunk\",\"created\":1749735010,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jxj5aw5ye88aphk95cevx8vk\"}}\n\ndata: {\"id\":\"chatcmpl-a89b0207-c3a0-4bf7-9405-f766a88e1c0e\",\"object\":\"chat.completion.chunk\",\"created\":1749735010,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"habjvxvnm\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"delete\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-a89b0207-c3a0-4bf7-9405-f766a88e1c0e\",\"object\":\"chat.completion.chunk\",\"created\":1749735010,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5aw5ye88aphk95cevx8vk\",\"usage\":{\"queue_time\":0.091916833,\"prompt_tokens\":917,\"prompt_time\":0.097275114,\"completion_tokens\":17,\"completion_time\":0.071132729,\"total_tokens\":934,\"total_time\":0.168407843}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-cf156c4b-1d1c-4bff-9649-48852bee4d29\",\"object\":\"chat.completion.chunk\",\"created\":1752130622,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz4rwf0ys9nxyd6zkcag4\"}}\n\ndata: {\"id\":\"chatcmpl-cf156c4b-1d1c-4bff-9649-48852bee4d29\",\"object\":\"chat.completion.chunk\",\"created\":1752130622,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"reka4zs7b\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"delete\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-cf156c4b-1d1c-4bff-9649-48852bee4d29\",\"object\":\"chat.completion.chunk\",\"created\":1752130622,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz4rwf0ys9nxyd6zkcag4\",\"usage\":{\"queue_time\":0.042112098,\"prompt_tokens\":913,\"prompt_time\":0.053917388,\"completion_tokens\":21,\"completion_time\":0.092937148,\"total_tokens\":934,\"total_time\":0.146854536}}}\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)/delete first block_1_002ed2fb069e97008c626fe8c2d43637.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)/delete first block_1_9b505e5406bea6b6aa0194536538eed7.json similarity index 71% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_002ed2fb069e97008c626fe8c2d43637.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_9b505e5406bea6b6aa0194536538eed7.json index 5bcb711e73..306b04e439 100644 --- 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)/delete first block_1_002ed2fb069e97008c626fe8c2d43637.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)/delete first block_1_9b505e5406bea6b6aa0194536538eed7.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"delete 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"delete 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcI3sMnTkzPLx2YpZZwDCdbjMBrs\",\n \"object\": \"chat.completion\",\n \"created\": 1749734991,\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_Qoi0xLvOY9avWlA7uhSLCG3X\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 639,\n \"completion_tokens\": 15,\n \"total_tokens\": 654,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfV6mx7ZeRrbIoWo8Ecm9hDlwjkR\",\n \"object\": \"chat.completion\",\n \"created\": 1752130612,\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_R2n7sEr3kWwxDTglZXSCILJw\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 639,\n \"completion_tokens\": 15,\n \"total_tokens\": 654,\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\": null\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)/delete first block_1_4fd26859e74455f20838c0acf2b72429.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)/delete first block_1_4fd26859e74455f20838c0acf2b72429.json new file mode 100644 index 0000000000..f2aa40a8a6 --- /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)/delete first block_1_4fd26859e74455f20838c0acf2b72429.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"delete 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\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_vrFeBFEA6cj2TqvjDOn6DbPu\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"delete\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUhOUPuuxBpfvqRmESt2Zs1vMNZ\",\"object\":\"chat.completion.chunk\",\"created\":1752130587,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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)/delete first block_1_af53bf5e53a86669deaae43b9ab27c67.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)/delete first block_1_af53bf5e53a86669deaae43b9ab27c67.json deleted file mode 100644 index dbf813cba8..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/delete first block_1_af53bf5e53a86669deaae43b9ab27c67.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"delete 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\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_0zSWbxFl0OJDmIl2BHOMN81Q\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"delete\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHGgVcZeJ250C4loyeBsxGFaLnY\",\"object\":\"chat.completion.chunk\",\"created\":1749734942,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_a97a8a61e45a5cfa1f37771aefbf06ba.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_8978afc5c34284715a8914c2fd570f93.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_a97a8a61e45a5cfa1f37771aefbf06ba.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_8978afc5c34284715a8914c2fd570f93.json index e953dd7d73..2c379baf63 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_a97a8a61e45a5cfa1f37771aefbf06ba.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_8978afc5c34284715a8914c2fd570f93.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01N8ZPuPYB7uEm8M4AWSjcqe\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01KtKWJMCdgNguaYxd28mxVE\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

Hi, world! Bold the text. Link.

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1251,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":79,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01UL78pjP1mQTm9dACxJDJYm\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Vdop2RgvVNBqqvcUiNjztc\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

Hi, world! Bold the text. Link.

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1242,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":79,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_80d39d8c2f69d28a6aec0dee64eb7b4f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_938010771c761a751ffbec3118e90f37.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_80d39d8c2f69d28a6aec0dee64eb7b4f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_938010771c761a751ffbec3118e90f37.json index c09ad59899..0eb21e214b 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_80d39d8c2f69d28a6aec0dee64eb7b4f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_938010771c761a751ffbec3118e90f37.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01WshLJncwcNPtL78vcvQzce\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01TrpG8BMCqKkK2LimWt85WE\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

Hello, world! Bold text. Link.

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1244,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":78,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01N64TbD7JjZBiNvgCDkBvwN\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01DRHRuKTsNnz6EBRqmdPatP\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

Hello, world! Bold text. Link.

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1235,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":78,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_64d59c27de629179d00d268836aebcba.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_671661bffc93e10ce475a7a35f15d754.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_64d59c27de629179d00d268836aebcba.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_671661bffc93e10ce475a7a35f15d754.json index 0e86957740..dc65843a57 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_64d59c27de629179d00d268836aebcba.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_671661bffc93e10ce475a7a35f15d754.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_015zSCLEKvFZtY5fVGuSSDmt\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_015a8DZf63rupvgAefdHGeR7\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

APPLES

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1115,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":73,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01WEue5ctg8aqtZHMtaKqTRi\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Ti59EXKH4GgQy1MDkez3Qd\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

APPLES

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1106,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":73,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_7cb863416d6d953446640251160e084e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_3be350bb2a881627e6d2c9bf1c977133.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_7cb863416d6d953446640251160e084e.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_3be350bb2a881627e6d2c9bf1c977133.json index 4d93f5eafb..c23ba27088 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_7cb863416d6d953446640251160e084e.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_3be350bb2a881627e6d2c9bf1c977133.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01EREiVxkFNYhnHJQEz9V1h1\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01L6pjMs7BD43cVyLrZthDjv\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

I NEED TO BUY:

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1116,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":77,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01BNeAhVWfspJUnJ8Z6AMC9L\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01CgXXqepiHC4mkca4HqFpHu\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

I NEED TO BUY:

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1107,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":77,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_c6025cf7f6efc3b57f721752b1f49801.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_fbbe189dec37c71e5cfc78fa72504cd6.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_c6025cf7f6efc3b57f721752b1f49801.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_fbbe189dec37c71e5cfc78fa72504cd6.json index 2c30b3825a..14ead4d8cc 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_c6025cf7f6efc3b57f721752b1f49801.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_fbbe189dec37c71e5cfc78fa72504cd6.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01KhdodTPyiRMTeuhSZ5ZjdR\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_012qWf9Pi57N7p3kVpefJ6i2\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, @Jane Doe!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":100,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01UESmM2GriLAX5sGyaYnJnF\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01E4zUZxLC83wvHFv9tGreoz\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, @Jane Doe!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1234,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":100,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_b3b73d97f68d26aba18541b8c809ec4d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_fa30387ecfa9d5ca59f612c7ab97f4bd.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_b3b73d97f68d26aba18541b8c809ec4d.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_fa30387ecfa9d5ca59f612c7ab97f4bd.json index 67a0dadf29..810cf4104a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_b3b73d97f68d26aba18541b8c809ec4d.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_fa30387ecfa9d5ca59f612c7ab97f4bd.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_017iNpsB8Va5vPjdhyhqZCuT\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01CeQ65A1Cs6j5dRjXBLZw5u\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hallo, Welt!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1233,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":77,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_0147tYCBmMV6CX1AU9reZrqB\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_019voEwSNh5q7ibuSXqYrXtv\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hallo, Welt!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1224,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":77,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_f6a509381d62c4242864af576bb7ba61.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_db38bde293870f2bef2303384e4e0a55.json similarity index 71% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_f6a509381d62c4242864af576bb7ba61.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_db38bde293870f2bef2303384e4e0a55.json index f816e54df4..5a1c4d1c36 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_f6a509381d62c4242864af576bb7ba61.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_db38bde293870f2bef2303384e4e0a55.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01T5eTMHU9eCnjDMRvAEBjMU\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_014m68VB7ydfSHyFBtzBSzYz\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

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

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1235,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":123,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_011k2XyH2i29VSFzXCrFkGc9\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01P2rfneXeKRy7UGE4TFXfgn\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

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

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1226,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":123,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_61539d923364c797cda8519b7d6dbb77.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_2b37d06351765e430fa35e5ca5c63dec.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_61539d923364c797cda8519b7d6dbb77.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_2b37d06351765e430fa35e5ca5c63dec.json index b4270ffcc2..7386751553 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_61539d923364c797cda8519b7d6dbb77.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_2b37d06351765e430fa35e5ca5c63dec.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01RX6G9jptDHomxj76CmVd7S\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_012Yj69Ms3C81E4d6yG4KMvH\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1252,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":100,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_015fmddXQqMsbWzkkEeVfhPu\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01SzYKwYCtodohhUX7WNqkJJ\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":100,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_a73907775c98b6c395eac24591e7f1d4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_7a40338400651cdf9b96bdf8da120da9.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_a73907775c98b6c395eac24591e7f1d4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_7a40338400651cdf9b96bdf8da120da9.json index 66a64e1798..fbcb862e2a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_a73907775c98b6c395eac24591e7f1d4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_7a40338400651cdf9b96bdf8da120da9.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_0129Z5hRLciD4JxkrsBWXxUu\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01DkPKMHFKRCRW8cDeAGbmBw\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, updated content

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1242,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":74,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01RoNiEWetzS77gAjv4wSFyS\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01616pz8YPfP8HsCFhqWuFS5\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, updated content

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1233,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":74,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_1821b0f5da6b0bdb28f9444c6eaca222.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_2d883e86ea71cfb987a22379a3edfa77.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_1821b0f5da6b0bdb28f9444c6eaca222.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_2d883e86ea71cfb987a22379a3edfa77.json index a241019180..b98c0fbe2a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_1821b0f5da6b0bdb28f9444c6eaca222.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_2d883e86ea71cfb987a22379a3edfa77.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01HQJNjBo6mEKgi3R8nsqFNm\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0139SFj714NEo6pJSNSgBWwF\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

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

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1234,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":129,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_012HsBgZs2dPJ3NFdyypdg1T\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_013tF2YRgBEBHsV6VQgUprWg\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

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

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1225,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":129,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_82f2d8a07824544fad31d34c8a554af1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_3ccdc93a62d16ec0bcf50be253c1dc56.json similarity index 62% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_82f2d8a07824544fad31d34c8a554af1.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_3ccdc93a62d16ec0bcf50be253c1dc56.json index 595a27e378..bfeff56875 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_82f2d8a07824544fad31d34c8a554af1.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_3ccdc93a62d16ec0bcf50be253c1dc56.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the second block to german (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_015UBfyAHuAg9oWnHmdVvgx6\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01QLFeGscd5ykaUUYYHnSQ12\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1242,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":135,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01PNsxAH685hBpcgFVitkwBc\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01LcMhrhDqgPSi2MZ5cTCWvK\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1236,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":135,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_c8bc122a4cb48783ca677fc4aa6cd947.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_809e0216515551c13573267a351ba535.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_c8bc122a4cb48783ca677fc4aa6cd947.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_809e0216515551c13573267a351ba535.json index 7f5781e7f7..df12c490d2 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_c8bc122a4cb48783ca677fc4aa6cd947.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_809e0216515551c13573267a351ba535.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01BT23qANxpUeDjKjfaeGZKY\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_011QvEJTGc5eAPszXgDnfen6\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1231,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":77,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01HatEwcxgZY1DKj9mchxo1Y\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01NW9gmnqwJkrKrxnqwUyXtx\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1222,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":77,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_686bfcd92e4eb65462c1811ad4a3976d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_12dba322e1c862453710164ab8dacd01.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_686bfcd92e4eb65462c1811ad4a3976d.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_12dba322e1c862453710164ab8dacd01.json index ff75c40a7f..c0345439c6 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_686bfcd92e4eb65462c1811ad4a3976d.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_12dba322e1c862453710164ab8dacd01.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01YNgifoee2ApHCvcbUv6F4s\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Qza516FNYowDgEe8bMWcR1\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1239,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":78,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_017a8MQLnevkpVPNezSriwup\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01M8sA6AFWAQvhyoRcr1sWu8\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1230,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":78,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_2968b738a7996331d8faf2692d652c3c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_e8c60e9f841b4ab0a3e3542f57873ecf.json similarity index 64% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_2968b738a7996331d8faf2692d652c3c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_e8c60e9f841b4ab0a3e3542f57873ecf.json index b732387987..5dd3e3e44f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_2968b738a7996331d8faf2692d652c3c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_e8c60e9f841b4ab0a3e3542f57873ecf.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01Er5UtfeFjRGN7Jsb49jfZq\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_012kdUcZWZteCnMmByXK921h\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1060,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":73,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01714RP3q62xednjBECWjAUY\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_016ZZS4JiUiJegPyFiaWPvKy\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1051,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":73,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_dd8e963f842a261deec745e8d4608bfd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_0301237447d5b4413e7dadcad3480eb7.json similarity index 62% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_dd8e963f842a261deec745e8d4608bfd.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_0301237447d5b4413e7dadcad3480eb7.json index 8a649b862f..355edc18c5 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_dd8e963f842a261deec745e8d4608bfd.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_0301237447d5b4413e7dadcad3480eb7.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

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

Bananas

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

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

Bananas

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01HkQcuxXSEY6xNSfGTDBLiK\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01QAy8LuFt6EDgRTDDZtLrWw\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"\"},{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":989,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":101,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01QALgGGSC9WGQpSnLMuvRgD\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_011JtuhRpotkQ6NVzZYREhfS\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"\"},{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":980,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":101,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_06943ba0bda62a61f058ba07379ab4b7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_9206839a16fcfab9cdcdd9e45f09f1da.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_06943ba0bda62a61f058ba07379ab4b7.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_9206839a16fcfab9cdcdd9e45f09f1da.json index 12370f1d2e..1b6b350158 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_06943ba0bda62a61f058ba07379ab4b7.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_9206839a16fcfab9cdcdd9e45f09f1da.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01UCfMwbkNqA6JHPBtrnboJS\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01L7zqwvLmExryqVrW9Hoo7i\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

What's up, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1246,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":77,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_015v7W7a825p48DM5PUN9WYP\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Fc3dYSq696kqcGkfYyM48t\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

What's up, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1237,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":77,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_9e53c774c99f178f06b3c7b3608d1605.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_16071edfe34f45ccfeb3bb4b023da531.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_9e53c774c99f178f06b3c7b3608d1605.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_16071edfe34f45ccfeb3bb4b023da531.json index 0eb873c98f..469a90f255 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_9e53c774c99f178f06b3c7b3608d1605.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_16071edfe34f45ccfeb3bb4b023da531.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01LdqohecfEgaytnLTE2zCFc\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01AnkcSsB3ZhnXjD35SSr7ME\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1233,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":75,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_015oQpcK2QkLgfgt3zKnKhJK\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01C7vLhDeN9s25cYZQwG8Yv9\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1224,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":75,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_2b911dce06e556a512fa22d1a0042b5a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_fe18c50fd2feadd6457384d8fb8944ec.json similarity index 65% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_2b911dce06e556a512fa22d1a0042b5a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_fe18c50fd2feadd6457384d8fb8944ec.json index fa39da0a2f..bcade4ffb6 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_2b911dce06e556a512fa22d1a0042b5a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_fe18c50fd2feadd6457384d8fb8944ec.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-0a0059b2-4fac-4fca-8ed7-caa702b329ab\",\"object\":\"chat.completion\",\"created\":1749735018,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"jc7rtpehb\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHi, world! Bold the text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.095378242,\"prompt_tokens\":936,\"prompt_time\":0.06796029,\"completion_tokens\":39,\"completion_time\":0.141818182,\"total_tokens\":975,\"total_time\":0.209778472},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01jxj5b4a7fe3vvswz0xdqms8d\"}}\n", + "body": "{\"id\":\"chatcmpl-8e727e03-a636-4362-a2ae-46d6e57cd7c2\",\"object\":\"chat.completion\",\"created\":1752130628,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"vg2jfx0ar\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHi, world! Bold the text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.049818513,\"prompt_tokens\":932,\"prompt_time\":0.054304844,\"completion_tokens\":40,\"completion_time\":0.126835947,\"total_tokens\":972,\"total_time\":0.181140791},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshzaz2fp38knnz4eybgyww\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_f7d042c6ddd42b02098b813fe6e2da2b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_221aeca7fef5f125b53481e1b86ef472.json similarity index 65% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_f7d042c6ddd42b02098b813fe6e2da2b.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_221aeca7fef5f125b53481e1b86ef472.json index 629f27fed4..71d9d8b26a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_f7d042c6ddd42b02098b813fe6e2da2b.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_221aeca7fef5f125b53481e1b86ef472.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-36283777-5677-47d2-8f58-38a9e5508c23\",\"object\":\"chat.completion\",\"created\":1749735018,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"c7bp0vsax\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! Bold text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09498567599999999,\"prompt_tokens\":930,\"prompt_time\":0.067380771,\"completion_tokens\":37,\"completion_time\":0.140460143,\"total_tokens\":967,\"total_time\":0.207840914},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01jxj5b3z6fyn925m3hqpr4dhq\"}}\n", + "body": "{\"id\":\"chatcmpl-af901e8a-af7e-45b0-8dbd-38eb845c70ce\",\"object\":\"chat.completion\",\"created\":1752130628,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"7yvzyxhap\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! Bold text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.042057578,\"prompt_tokens\":926,\"prompt_time\":0.05542809,\"completion_tokens\":38,\"completion_time\":0.127755968,\"total_tokens\":964,\"total_time\":0.183184058},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshzanbf1094sqerb5qkkda\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify nested content_1_0cbaaf87b0c6b588f7d7e21f72ed7a7c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify nested content_1_556624e3ee02680707ba62c186d62e84.json similarity index 60% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify nested content_1_0cbaaf87b0c6b588f7d7e21f72ed7a7c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify nested content_1_556624e3ee02680707ba62c186d62e84.json index 657fc77b92..dd3ff91590 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify nested content_1_0cbaaf87b0c6b588f7d7e21f72ed7a7c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify nested content_1_556624e3ee02680707ba62c186d62e84.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-59e7cc8a-ffbc-45f8-9a4d-52a9f6061394\",\"object\":\"chat.completion\",\"created\":1749735019,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"dzaz7ptc7\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAPPLES\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.091278667,\"prompt_tokens\":821,\"prompt_time\":0.060325432,\"completion_tokens\":28,\"completion_time\":0.101818182,\"total_tokens\":849,\"total_time\":0.162143614},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01jxj5b56jfynt9dfq1r851ckm\"}}\n", + "body": "{\"id\":\"chatcmpl-f119b34d-7fb8-423a-9ae5-6125b2652ae5\",\"object\":\"chat.completion\",\"created\":1752130629,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"w06bnh4y3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAPPLES\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.045934326000000004,\"prompt_tokens\":817,\"prompt_time\":0.048545151,\"completion_tokens\":28,\"completion_time\":0.087203434,\"total_tokens\":845,\"total_time\":0.135748585},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshzbh1fp3tq8z3z1d3mqj8\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify parent content_1_d190a41cfce34eb5362468031cb608fe.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify parent content_1_c0bdc581c11c643bf23b9b9db2d63c81.json similarity index 60% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify parent content_1_d190a41cfce34eb5362468031cb608fe.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify parent content_1_c0bdc581c11c643bf23b9b9db2d63c81.json index 5d776eca98..608ee60b0a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify parent content_1_d190a41cfce34eb5362468031cb608fe.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify parent content_1_c0bdc581c11c643bf23b9b9db2d63c81.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-15f69ac0-28bc-4531-b442-8a3c8925a72a\",\"object\":\"chat.completion\",\"created\":1749735020,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"fnn6zcsvf\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eI NEED TO BUY:\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.095225931,\"prompt_tokens\":823,\"prompt_time\":0.062571264,\"completion_tokens\":29,\"completion_time\":0.114504493,\"total_tokens\":852,\"total_time\":0.177075757},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01jxj5b5j9e8k9rnzed899j9qm\"}}\n", + "body": "{\"id\":\"chatcmpl-182b0f11-451a-4d55-a73a-becc9c0450be\",\"object\":\"chat.completion\",\"created\":1752130629,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"m3wayd04v\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eI NEED TO BUY:\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.042559067000000006,\"prompt_tokens\":819,\"prompt_time\":0.049295432,\"completion_tokens\":33,\"completion_time\":0.111423815,\"total_tokens\":852,\"total_time\":0.160719247},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshzbqyf10rmv95ndarbf0e\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_963338caea5317fbaa588fed459f0895.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_0864d889b31cae8e316f6a78ef61df7d.json similarity index 67% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_963338caea5317fbaa588fed459f0895.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_0864d889b31cae8e316f6a78ef61df7d.json index 21e1aaeaf0..e75655158e 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_963338caea5317fbaa588fed459f0895.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_0864d889b31cae8e316f6a78ef61df7d.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-3c345197-2895-4bb6-9ad4-413e3e70fde2\",\"object\":\"chat.completion\",\"created\":1749735017,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"e60an3q24\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.097209326,\"prompt_tokens\":928,\"prompt_time\":0.091335491,\"completion_tokens\":48,\"completion_time\":0.174545455,\"total_tokens\":976,\"total_time\":0.265880946},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_6507bcfb6f\",\"x_groq\":{\"id\":\"req_01jxj5b32tfe38ajb4c77z001d\"}}\n", + "body": "{\"id\":\"chatcmpl-1b615d9a-1888-4096-934a-f980318d5519\",\"object\":\"chat.completion\",\"created\":1752130627,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"m6w0snb13\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.047845329,\"prompt_tokens\":924,\"prompt_time\":0.054323924,\"completion_tokens\":52,\"completion_time\":0.138502293,\"total_tokens\":976,\"total_time\":0.192826217},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshza1gf0zvhtjv17wdzwz1\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_da09ee8bda5dc347edc748b59bc3bb16.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_f80b18afddb894d5ef20c2e5b40d1735.json similarity index 64% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_da09ee8bda5dc347edc748b59bc3bb16.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_f80b18afddb894d5ef20c2e5b40d1735.json index 244a002d07..0d2dceaff7 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_da09ee8bda5dc347edc748b59bc3bb16.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_f80b18afddb894d5ef20c2e5b40d1735.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-6af3ddde-3e39-4181-81a6-c383d580b74f\",\"object\":\"chat.completion\",\"created\":1749735013,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"3fq3rx70z\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, Welt!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.097637048,\"prompt_tokens\":919,\"prompt_time\":0.066832789,\"completion_tokens\":33,\"completion_time\":0.12,\"total_tokens\":952,\"total_time\":0.186832789},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_6507bcfb6f\",\"x_groq\":{\"id\":\"req_01jxj5az8be8btaxwhjr6w89e3\"}}\n", + "body": "{\"id\":\"chatcmpl-f3ee1824-e5f5-49ae-92ff-875d3918f01e\",\"object\":\"chat.completion\",\"created\":1752130624,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"5jv7x8gdb\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, Welt!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.06414945,\"prompt_tokens\":915,\"prompt_time\":0.053597422,\"completion_tokens\":33,\"completion_time\":0.104425786,\"total_tokens\":948,\"total_time\":0.158023208},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshz758f0ytxttx0mfe2xbr\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_90482aba878618976330fda1af8f6766.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_de6fb747b4d41b8d888fabe55320091c.json similarity index 67% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_90482aba878618976330fda1af8f6766.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_de6fb747b4d41b8d888fabe55320091c.json index 9480973cce..7f90fed360 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_90482aba878618976330fda1af8f6766.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_de6fb747b4d41b8d888fabe55320091c.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-747b84da-9146-4615-9f0c-5ab6ce3787e7\",\"object\":\"chat.completion\",\"created\":1749735016,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"9tmydrj6p\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! How are you doing? \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.0944564,\"prompt_tokens\":921,\"prompt_time\":0.067310533,\"completion_tokens\":68,\"completion_time\":0.247272727,\"total_tokens\":989,\"total_time\":0.31458326},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01jxj5b1f4e8dr1421eceg24q3\"}}\n", + "body": "{\"id\":\"chatcmpl-a36af9d4-bdf6-4860-99a3-cfec4630209f\",\"object\":\"chat.completion\",\"created\":1752130626,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"4qt4ybvjm\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! How are you doing? \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.041843337,\"prompt_tokens\":917,\"prompt_time\":0.05372706,\"completion_tokens\":72,\"completion_time\":0.165936626,\"total_tokens\":989,\"total_time\":0.219663686},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshz8z8f0z8pvrkkamnfpbp\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_5c149679babf73b41810f291fcb4d558.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_c0ff836d1dce7a2f6e6f86f220640315.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_5c149679babf73b41810f291fcb4d558.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_c0ff836d1dce7a2f6e6f86f220640315.json index 9f9a358287..9cbc670385 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_5c149679babf73b41810f291fcb4d558.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_c0ff836d1dce7a2f6e6f86f220640315.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-662f80c1-1e27-4cc4-becb-e23e7430bd5b\",\"object\":\"chat.completion\",\"created\":1749735016,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"yk036akhj\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09265462099999999,\"prompt_tokens\":937,\"prompt_time\":0.075315932,\"completion_tokens\":51,\"completion_time\":0.185454545,\"total_tokens\":988,\"total_time\":0.260770477},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_6507bcfb6f\",\"x_groq\":{\"id\":\"req_01jxj5b1xpfe186twtsqe1h98k\"}}\n", + "body": "{\"id\":\"chatcmpl-c37d08f3-14ba-4d19-8159-a50f4ce11bb3\",\"object\":\"chat.completion\",\"created\":1752130626,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"hcv38fb6e\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.04244616100000001,\"prompt_tokens\":933,\"prompt_time\":0.054731669,\"completion_tokens\":56,\"completion_time\":0.142669785,\"total_tokens\":989,\"total_time\":0.197401454},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshz98sfp296wz5q6gn7tsb\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_0c9d3ace7da95353a998edbaff79177d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_da5f1ab6fa91c869e64322937264846f.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_0c9d3ace7da95353a998edbaff79177d.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_da5f1ab6fa91c869e64322937264846f.json index 4b5a10c092..c375dbe634 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_0c9d3ace7da95353a998edbaff79177d.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_da5f1ab6fa91c869e64322937264846f.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-0bd8b980-c796-42d8-902d-1ebb7ebf9b7c\",\"object\":\"chat.completion\",\"created\":1749735015,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"sxzys1xdq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, updated content\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.091268419,\"prompt_tokens\":927,\"prompt_time\":0.070687647,\"completion_tokens\":29,\"completion_time\":0.105454545,\"total_tokens\":956,\"total_time\":0.176142192},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_6507bcfb6f\",\"x_groq\":{\"id\":\"req_01jxj5b0jcfyjrqr8rjwpj2wnw\"}}\n", + "body": "{\"id\":\"chatcmpl-339215a3-67be-4117-92d9-19a71dc91686\",\"object\":\"chat.completion\",\"created\":1752130625,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"n4jbae2bv\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, updated content\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.043305446000000004,\"prompt_tokens\":923,\"prompt_time\":0.054613321,\"completion_tokens\":34,\"completion_time\":0.11000824,\"total_tokens\":957,\"total_time\":0.164621561},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshz874f0zaxfat4556qa0r\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_57893638a0ceb0edac342346fa706076.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_38b3b843f1c225ba4b5fae0ea9fe7d69.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_57893638a0ceb0edac342346fa706076.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_38b3b843f1c225ba4b5fae0ea9fe7d69.json index ef0b687eed..3fe769d217 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_57893638a0ceb0edac342346fa706076.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_38b3b843f1c225ba4b5fae0ea9fe7d69.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-560695aa-740c-4124-a7bb-0b7d57337dc5\",\"object\":\"chat.completion\",\"created\":1749735018,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"2kys5r12k\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09206929600000001,\"prompt_tokens\":919,\"prompt_time\":0.066914509,\"completion_tokens\":73,\"completion_time\":0.265454545,\"total_tokens\":992,\"total_time\":0.332369054},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_6507bcfb6f\",\"x_groq\":{\"id\":\"req_01jxj5b3fzfynb6ayc45e8may4\"}}\n", + "body": "{\"id\":\"chatcmpl-f18572c4-ec38-4bc7-bbf4-084f1198ceb4\",\"object\":\"chat.completion\",\"created\":1752130627,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"9cwd17dp3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.042128864,\"prompt_tokens\":915,\"prompt_time\":0.054152145,\"completion_tokens\":78,\"completion_time\":0.179883086,\"total_tokens\":993,\"total_time\":0.234035231},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshzaajfp28rqnzfkdsbn7b\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_ef01870ca5f4083b4ea345e00d3c52ff.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_b5b0d849bf7cfd45920a42b802840eb0.json similarity index 56% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_ef01870ca5f4083b4ea345e00d3c52ff.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_b5b0d849bf7cfd45920a42b802840eb0.json index 777ff6d3c9..cc873fe077 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_ef01870ca5f4083b4ea345e00d3c52ff.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_b5b0d849bf7cfd45920a42b802840eb0.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the second block to german (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-1203f94c-5842-466e-a9a0-16a6ed99f299\",\"object\":\"chat.completion\",\"created\":1749735015,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"rft12t7k3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eWie geht es dir?\\\\u003c/strong\\\\u003e \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eDieser Text ist blau!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09413443099999999,\"prompt_tokens\":926,\"prompt_time\":0.067385051,\"completion_tokens\":80,\"completion_time\":0.290909091,\"total_tokens\":1006,\"total_time\":0.358294142},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01jxj5b0w9fe0bfppftqpmf978\"}}\n", + "body": "{\"id\":\"chatcmpl-56526601-6c63-41d5-b139-fc5b7b221e6e\",\"object\":\"chat.completion\",\"created\":1752131310,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"2zd46gkvb\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eWie geht es dir?\\\\u003c/strong\\\\u003e \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eDieser Text ist blau!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.042922552,\"prompt_tokens\":925,\"prompt_time\":0.074055373,\"completion_tokens\":80,\"completion_time\":0.202216154,\"total_tokens\":1005,\"total_time\":0.276271527},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzsjm4sae548dx28kgw1dxy3\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (paragraph)_1_ee8107efdf5fd19552a7fff0b08f6657.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (paragraph)_1_15b8c82decbf30a714f2df977d22c034.json similarity index 64% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (paragraph)_1_ee8107efdf5fd19552a7fff0b08f6657.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (paragraph)_1_15b8c82decbf30a714f2df977d22c034.json index fc97d37be7..2f6878b256 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (paragraph)_1_ee8107efdf5fd19552a7fff0b08f6657.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (paragraph)_1_15b8c82decbf30a714f2df977d22c034.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-13f5782f-d9ec-4f50-91f1-5fbe4ef0bad7\",\"object\":\"chat.completion\",\"created\":1749735017,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"zy1v4qek7\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003e\\\\u003cstrong\\\\u003eHello, world!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.092341545,\"prompt_tokens\":917,\"prompt_time\":0.070101534,\"completion_tokens\":32,\"completion_time\":0.116363636,\"total_tokens\":949,\"total_time\":0.18646517},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01jxj5b2refynbsjf914e77gyf\"}}\n", + "body": "{\"id\":\"chatcmpl-d695918d-5638-49bc-b25b-cc00e80a0a74\",\"object\":\"chat.completion\",\"created\":1752130909,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"1vgwvkeb6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003e\\\\u003cstrong\\\\u003eHello, world!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.042486897999999995,\"prompt_tokens\":913,\"prompt_time\":0.062177654,\"completion_tokens\":37,\"completion_time\":0.127415833,\"total_tokens\":950,\"total_time\":0.189593487},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzsj7xntf6tsqbs8gakw6ebb\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_ca95d8d83853d5deb4765c6768a2563f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_7b3ed3b4d44c3e948694f0ea709b6a18.json similarity index 64% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_ca95d8d83853d5deb4765c6768a2563f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_7b3ed3b4d44c3e948694f0ea709b6a18.json index 04ffd818da..e7a5f11577 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_ca95d8d83853d5deb4765c6768a2563f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_7b3ed3b4d44c3e948694f0ea709b6a18.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-bd3b9341-1bda-404b-9e9f-153dcb85b8cb\",\"object\":\"chat.completion\",\"created\":1749735016,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"84bsd4kgd\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cstrong\\\\u003eworld!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09764628199999999,\"prompt_tokens\":924,\"prompt_time\":0.070288056,\"completion_tokens\":33,\"completion_time\":0.120895169,\"total_tokens\":957,\"total_time\":0.191183225},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_6507bcfb6f\",\"x_groq\":{\"id\":\"req_01jxj5b2bwe8e83ptw01bkgxpt\"}}\n", + "body": "{\"id\":\"chatcmpl-1d2af19b-0f66-448f-a0c6-34c247ecaa67\",\"object\":\"chat.completion\",\"created\":1752130627,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"2af35dg46\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cstrong\\\\u003eworld!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.042393390999999996,\"prompt_tokens\":920,\"prompt_time\":0.053619961,\"completion_tokens\":33,\"completion_time\":0.108697727,\"total_tokens\":953,\"total_time\":0.162317688},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshz9hkf0zvn1vrtpt6sb21\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translate selection_1_674d4ec4b8af2ac528ec90892731f67a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translate selection_1_b44a83174a714b0c75c0ae03566175c0.json similarity index 59% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translate selection_1_674d4ec4b8af2ac528ec90892731f67a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translate selection_1_b44a83174a714b0c75c0ae03566175c0.json index c1018e06cf..18bcfbf3f0 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translate selection_1_674d4ec4b8af2ac528ec90892731f67a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translate selection_1_b44a83174a714b0c75c0ae03566175c0.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-3571c817-02fc-4749-9ac0-8a18dc61bc81\",\"object\":\"chat.completion\",\"created\":1749735014,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"f5nhkrap9\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.095579791,\"prompt_tokens\":760,\"prompt_time\":0.05653729,\"completion_tokens\":31,\"completion_time\":0.112727273,\"total_tokens\":791,\"total_time\":0.169264563},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01jxj5azjre8bsb47khdp14b8q\"}}\n", + "body": "{\"id\":\"chatcmpl-58eddfeb-dbef-4fca-bd40-7351fd621d41\",\"object\":\"chat.completion\",\"created\":1752130624,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"55bs8e46k\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.059864453000000005,\"prompt_tokens\":756,\"prompt_time\":0.045571254,\"completion_tokens\":31,\"completion_time\":0.100762269,\"total_tokens\":787,\"total_time\":0.146333523},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshz7d1fp1rh2x9r12qn394\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/turn paragraphs into list_1_1ec910c96203d1d86b7dcce97e352e91.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/turn paragraphs into list_1_0d58195328e2194c6d2466a4ff9f8bc5.json similarity index 58% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/turn paragraphs into list_1_1ec910c96203d1d86b7dcce97e352e91.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/turn paragraphs into list_1_0d58195328e2194c6d2466a4ff9f8bc5.json index f32cb59063..03e92bb049 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/turn paragraphs into list_1_1ec910c96203d1d86b7dcce97e352e91.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/turn paragraphs into list_1_0d58195328e2194c6d2466a4ff9f8bc5.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-15dceb8e-571a-42ee-8457-01a8b73cdaf9\",\"object\":\"chat.completion\",\"created\":1749735019,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"d7rqs6x9n\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.092574184,\"prompt_tokens\":706,\"prompt_time\":0.053633147,\"completion_tokens\":66,\"completion_time\":0.24,\"total_tokens\":772,\"total_time\":0.293633147},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_6507bcfb6f\",\"x_groq\":{\"id\":\"req_01jxj5b4rtfynrswwzkftnkbb7\"}}\n", + "body": "{\"id\":\"chatcmpl-02eece49-ae3e-4cf6-9239-1cc8d4c3c2fe\",\"object\":\"chat.completion\",\"created\":1752130628,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"4efkhb0kc\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.04979548300000001,\"prompt_tokens\":702,\"prompt_time\":0.036323771,\"completion_tokens\":65,\"completion_time\":0.144687982,\"total_tokens\":767,\"total_time\":0.181011753},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshzb8nf10990c8xqqf1khf\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_e09825f3b2477a73e86972716897a19e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_25e6f872caa48f5825f7ceb4b0f78655.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_e09825f3b2477a73e86972716897a19e.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_25e6f872caa48f5825f7ceb4b0f78655.json index 5ecaf3b116..6c767c3d57 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_e09825f3b2477a73e86972716897a19e.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_25e6f872caa48f5825f7ceb4b0f78655.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-0f1231e8-6b2e-4b7f-b00c-553e68281f78\",\"object\":\"chat.completion\",\"created\":1749735014,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"h7ggbyjvf\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eWhat's up, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09288939100000002,\"prompt_tokens\":931,\"prompt_time\":0.080010843,\"completion_tokens\":33,\"completion_time\":0.12,\"total_tokens\":964,\"total_time\":0.200010843},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_6507bcfb6f\",\"x_groq\":{\"id\":\"req_01jxj5b07qfyhskj442k2z7q1w\"}}\n", + "body": "{\"id\":\"chatcmpl-0c4bf7e2-049b-41a9-bb1d-38b30a2326a1\",\"object\":\"chat.completion\",\"created\":1752130625,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"7ms8xeq0c\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eWhat's up, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.04284542100000001,\"prompt_tokens\":927,\"prompt_time\":0.070752394,\"completion_tokens\":33,\"completion_time\":0.105121718,\"total_tokens\":960,\"total_time\":0.175874112},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshz7z3fp2azb60hza50wta\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_cf54cfb6c7dfc32b6429ca1a2302a2b6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_1199a83747eb0f064e1c6badaa3e788d.json similarity index 65% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_cf54cfb6c7dfc32b6429ca1a2302a2b6.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_1199a83747eb0f064e1c6badaa3e788d.json index 0b365ed691..461140c855 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_cf54cfb6c7dfc32b6429ca1a2302a2b6.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_1199a83747eb0f064e1c6badaa3e788d.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"chatcmpl-b5b5fedf-19dd-425b-9c51-82f5315b4e12\",\"object\":\"chat.completion\",\"created\":1749735014,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"pwn702svm\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eHello, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09234229,\"prompt_tokens\":919,\"prompt_time\":0.092418991,\"completion_tokens\":30,\"completion_time\":0.112312109,\"total_tokens\":949,\"total_time\":0.2047311},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_6507bcfb6f\",\"x_groq\":{\"id\":\"req_01jxj5azwve8bvxw56q80cqea4\"}}\n", + "body": "{\"id\":\"chatcmpl-cbd4dafb-2032-49d3-87df-dc8436886380\",\"object\":\"chat.completion\",\"created\":1752130625,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"v86058nsz\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eHello, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.04222492,\"prompt_tokens\":915,\"prompt_time\":0.060294975,\"completion_tokens\":34,\"completion_time\":0.104280377,\"total_tokens\":949,\"total_time\":0.164575352},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_c65b1b4a5f\",\"x_groq\":{\"id\":\"req_01jzshz7mbf0yr14q8bg1c7n30\"}}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_efeeda50dc4be1869d555c44cc00a5f5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_5936286917db7874ab151e025d44f0ec.json similarity index 59% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_efeeda50dc4be1869d555c44cc00a5f5.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_5936286917db7874ab151e025d44f0ec.json index ef44649db6..ca173acf5f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_efeeda50dc4be1869d555c44cc00a5f5.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_5936286917db7874ab151e025d44f0ec.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-ab20c779-9448-46be-b5ec-aa59014798e4\",\"object\":\"chat.completion.chunk\",\"created\":1749735008,\"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_01jxj5atgvfdfv4ym3taazgrdx\"}}\n\ndata: {\"id\":\"chatcmpl-ab20c779-9448-46be-b5ec-aa59014798e4\",\"object\":\"chat.completion.chunk\",\"created\":1749735009,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"am9yf5frq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHi, world! Bold the text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-ab20c779-9448-46be-b5ec-aa59014798e4\",\"object\":\"chat.completion.chunk\",\"created\":1749735009,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5atgvfdfv4ym3taazgrdx\",\"usage\":{\"queue_time\":0.091661228,\"prompt_tokens\":936,\"prompt_time\":0.070865053,\"completion_tokens\":35,\"completion_time\":0.127272727,\"total_tokens\":971,\"total_time\":0.19813778}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-2ce8c7f1-d53f-4660-ac0f-978b1f7c3f1f\",\"object\":\"chat.completion.chunk\",\"created\":1752130621,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz3qpf0y9fvvn9e53fxty\"}}\n\ndata: {\"id\":\"chatcmpl-2ce8c7f1-d53f-4660-ac0f-978b1f7c3f1f\",\"object\":\"chat.completion.chunk\",\"created\":1752130621,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"spcvsxp2a\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHi, world! Bold the text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-2ce8c7f1-d53f-4660-ac0f-978b1f7c3f1f\",\"object\":\"chat.completion.chunk\",\"created\":1752130621,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz3qpf0y9fvvn9e53fxty\",\"usage\":{\"queue_time\":0.041919371,\"prompt_tokens\":932,\"prompt_time\":0.064693495,\"completion_tokens\":40,\"completion_time\":0.124060279,\"total_tokens\":972,\"total_time\":0.188753774}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_e3ff518cb46e814abe773f4184678323.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_4aa07cf0823d35359854ab671dd8403a.json similarity index 59% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_e3ff518cb46e814abe773f4184678323.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_4aa07cf0823d35359854ab671dd8403a.json index 104e6b5adf..3d2974fe32 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_e3ff518cb46e814abe773f4184678323.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_4aa07cf0823d35359854ab671dd8403a.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-bda185f6-a5d1-4bca-a598-94cc4188d845\",\"object\":\"chat.completion.chunk\",\"created\":1749735008,\"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_01jxj5at55e7ka3av6c6zgghc6\"}}\n\ndata: {\"id\":\"chatcmpl-bda185f6-a5d1-4bca-a598-94cc4188d845\",\"object\":\"chat.completion.chunk\",\"created\":1749735008,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"mjvkk8pj4\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! Bold text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-bda185f6-a5d1-4bca-a598-94cc4188d845\",\"object\":\"chat.completion.chunk\",\"created\":1749735008,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5at55e7ka3av6c6zgghc6\",\"usage\":{\"queue_time\":0.120376244,\"prompt_tokens\":930,\"prompt_time\":0.071824831,\"completion_tokens\":37,\"completion_time\":0.148695309,\"total_tokens\":967,\"total_time\":0.22052014}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-91edc165-8e69-4a75-ab1d-0d0fd7a2d0a8\",\"object\":\"chat.completion.chunk\",\"created\":1752130620,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz3c3fp0b208pczcb6yw5\"}}\n\ndata: {\"id\":\"chatcmpl-91edc165-8e69-4a75-ab1d-0d0fd7a2d0a8\",\"object\":\"chat.completion.chunk\",\"created\":1752130621,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"fnj3jknav\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! Bold text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-91edc165-8e69-4a75-ab1d-0d0fd7a2d0a8\",\"object\":\"chat.completion.chunk\",\"created\":1752130621,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz3c3fp0b208pczcb6yw5\",\"usage\":{\"queue_time\":0.042832248999999996,\"prompt_tokens\":926,\"prompt_time\":0.060473853,\"completion_tokens\":38,\"completion_time\":0.137656373,\"total_tokens\":964,\"total_time\":0.198130226}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_c335661f5c1022666f7905497d4a3189.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_f2b4ede7c5fa7fe6f53f0224d9c843e6.json similarity index 54% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_c335661f5c1022666f7905497d4a3189.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_f2b4ede7c5fa7fe6f53f0224d9c843e6.json index 7cb71e4b8f..182aad96f4 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_c335661f5c1022666f7905497d4a3189.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_f2b4ede7c5fa7fe6f53f0224d9c843e6.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-df7ca105-fced-41ce-ad45-5beb04788d16\",\"object\":\"chat.completion.chunk\",\"created\":1749735009,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jxj5avftfy9ae7d67xk37vnx\"}}\n\ndata: {\"id\":\"chatcmpl-df7ca105-fced-41ce-ad45-5beb04788d16\",\"object\":\"chat.completion.chunk\",\"created\":1749735010,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"q33e2wb1n\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAPPLES\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-df7ca105-fced-41ce-ad45-5beb04788d16\",\"object\":\"chat.completion.chunk\",\"created\":1749735010,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5avftfy9ae7d67xk37vnx\",\"usage\":{\"queue_time\":0.093065395,\"prompt_tokens\":821,\"prompt_time\":0.08815517,\"completion_tokens\":28,\"completion_time\":0.102757079,\"total_tokens\":849,\"total_time\":0.190912249}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-2beccb40-00e0-4f89-bbd2-cd59115a61a9\",\"object\":\"chat.completion.chunk\",\"created\":1752130621,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz4acf0y9wet3d7835jcb\"}}\n\ndata: {\"id\":\"chatcmpl-2beccb40-00e0-4f89-bbd2-cd59115a61a9\",\"object\":\"chat.completion.chunk\",\"created\":1752130621,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"hsgtw7syj\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAPPLES\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-2beccb40-00e0-4f89-bbd2-cd59115a61a9\",\"object\":\"chat.completion.chunk\",\"created\":1752130621,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz4acf0y9wet3d7835jcb\",\"usage\":{\"queue_time\":0.041778130999999996,\"prompt_tokens\":817,\"prompt_time\":0.049104514,\"completion_tokens\":28,\"completion_time\":0.089891183,\"total_tokens\":845,\"total_time\":0.138995697}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_73db91187a949699f0fd921ebe60d841.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_37be7ebe33cd5e612c15b138aa8e868a.json similarity index 56% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_73db91187a949699f0fd921ebe60d841.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_37be7ebe33cd5e612c15b138aa8e868a.json index 3cd21bfd14..8e12fe8e76 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_73db91187a949699f0fd921ebe60d841.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_37be7ebe33cd5e612c15b138aa8e868a.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-2ac4240c-bb17-4eb4-aa83-85bf0d350ddf\",\"object\":\"chat.completion.chunk\",\"created\":1749735010,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jxj5avvse86adjxw0pbnkvvs\"}}\n\ndata: {\"id\":\"chatcmpl-2ac4240c-bb17-4eb4-aa83-85bf0d350ddf\",\"object\":\"chat.completion.chunk\",\"created\":1749735010,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"28n90hyyt\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eI NEED TO BUY:\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-2ac4240c-bb17-4eb4-aa83-85bf0d350ddf\",\"object\":\"chat.completion.chunk\",\"created\":1749735010,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5avvse86adjxw0pbnkvvs\",\"usage\":{\"queue_time\":0.093088333,\"prompt_tokens\":823,\"prompt_time\":0.063999636,\"completion_tokens\":29,\"completion_time\":0.117431576,\"total_tokens\":852,\"total_time\":0.181431212}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-c51e59fc-d6ac-44e0-a106-b399d5217034\",\"object\":\"chat.completion.chunk\",\"created\":1752130622,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz4hnfp08psxz1zhkynwp\"}}\n\ndata: {\"id\":\"chatcmpl-c51e59fc-d6ac-44e0-a106-b399d5217034\",\"object\":\"chat.completion.chunk\",\"created\":1752130622,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"w9jfzjen5\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eI NEED TO BUY:\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c51e59fc-d6ac-44e0-a106-b399d5217034\",\"object\":\"chat.completion.chunk\",\"created\":1752130622,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz4hnfp08psxz1zhkynwp\",\"usage\":{\"queue_time\":0.046987032,\"prompt_tokens\":819,\"prompt_time\":0.048854487,\"completion_tokens\":33,\"completion_time\":0.093927356,\"total_tokens\":852,\"total_time\":0.142781843}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_57f7d170977b8d3400a3a1d7182790b0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_3ab6cac43fb1418a242820f5fb741a80.json similarity index 60% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_57f7d170977b8d3400a3a1d7182790b0.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_3ab6cac43fb1418a242820f5fb741a80.json index 76a0b3c0d3..91e919f9fb 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_57f7d170977b8d3400a3a1d7182790b0.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_3ab6cac43fb1418a242820f5fb741a80.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-db9fe6ba-42d0-4a72-98f3-f1f03b3d19b2\",\"object\":\"chat.completion.chunk\",\"created\":1749735007,\"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_01jxj5as5efxvt3crw5aqszns8\"}}\n\ndata: {\"id\":\"chatcmpl-db9fe6ba-42d0-4a72-98f3-f1f03b3d19b2\",\"object\":\"chat.completion.chunk\",\"created\":1749735007,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"3hv0g18xg\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-db9fe6ba-42d0-4a72-98f3-f1f03b3d19b2\",\"object\":\"chat.completion.chunk\",\"created\":1749735007,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5as5efxvt3crw5aqszns8\",\"usage\":{\"queue_time\":0.091132312,\"prompt_tokens\":928,\"prompt_time\":0.070888062,\"completion_tokens\":52,\"completion_time\":0.189090909,\"total_tokens\":980,\"total_time\":0.259978971}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-9f3d67c9-9a33-43b3-a805-a1d9fd0ea127\",\"object\":\"chat.completion.chunk\",\"created\":1752130620,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz2q8fp0bnw0hjvwqdasj\"}}\n\ndata: {\"id\":\"chatcmpl-9f3d67c9-9a33-43b3-a805-a1d9fd0ea127\",\"object\":\"chat.completion.chunk\",\"created\":1752130620,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"cdemm0mrk\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-9f3d67c9-9a33-43b3-a805-a1d9fd0ea127\",\"object\":\"chat.completion.chunk\",\"created\":1752130620,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz2q8fp0bnw0hjvwqdasj\",\"usage\":{\"queue_time\":0.04198011200000001,\"prompt_tokens\":924,\"prompt_time\":0.059458594,\"completion_tokens\":52,\"completion_time\":0.148164272,\"total_tokens\":976,\"total_time\":0.207622866}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_67b27460b36b3013a36967448a8522c4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_45a526f03ac0adef7c3c45cb4cda6d5a.json similarity index 58% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_67b27460b36b3013a36967448a8522c4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_45a526f03ac0adef7c3c45cb4cda6d5a.json index 3f3e5b657b..a15643b350 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_67b27460b36b3013a36967448a8522c4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_45a526f03ac0adef7c3c45cb4cda6d5a.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-f58097b7-8214-4508-9101-7b0cee56b05b\",\"object\":\"chat.completion.chunk\",\"created\":1749735003,\"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_01jxj5anabe6zv7sd3sp6y81kz\"}}\n\ndata: {\"id\":\"chatcmpl-f58097b7-8214-4508-9101-7b0cee56b05b\",\"object\":\"chat.completion.chunk\",\"created\":1749735003,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"jqq92j178\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, Welt!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f58097b7-8214-4508-9101-7b0cee56b05b\",\"object\":\"chat.completion.chunk\",\"created\":1749735003,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5anabe6zv7sd3sp6y81kz\",\"usage\":{\"queue_time\":0.09239618899999999,\"prompt_tokens\":919,\"prompt_time\":0.067363913,\"completion_tokens\":33,\"completion_time\":0.12,\"total_tokens\":952,\"total_time\":0.187363913}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-f5884e6d-e7c5-4c37-9fb4-49466722229e\",\"object\":\"chat.completion.chunk\",\"created\":1752130617,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz008fnxs5hb7jj505tgg\"}}\n\ndata: {\"id\":\"chatcmpl-f5884e6d-e7c5-4c37-9fb4-49466722229e\",\"object\":\"chat.completion.chunk\",\"created\":1752130617,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"x3kkdqktq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, Welt!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f5884e6d-e7c5-4c37-9fb4-49466722229e\",\"object\":\"chat.completion.chunk\",\"created\":1752130617,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz008fnxs5hb7jj505tgg\",\"usage\":{\"queue_time\":0.04349676699999999,\"prompt_tokens\":915,\"prompt_time\":0.053398444,\"completion_tokens\":33,\"completion_time\":0.098967869,\"total_tokens\":948,\"total_time\":0.152366313}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_abd6ba31606c51fb682ca64b85af7008.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_466a1bc182d81c967fcd9dc2d0161046.json similarity index 61% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_abd6ba31606c51fb682ca64b85af7008.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_466a1bc182d81c967fcd9dc2d0161046.json index 93fd907c89..6e76554108 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_abd6ba31606c51fb682ca64b85af7008.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_466a1bc182d81c967fcd9dc2d0161046.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-6adcf90a-2455-498f-8323-e2e338e80d80\",\"object\":\"chat.completion.chunk\",\"created\":1749735005,\"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_01jxj5aqhxfxrv3kvg9by2hher\"}}\n\ndata: {\"id\":\"chatcmpl-6adcf90a-2455-498f-8323-e2e338e80d80\",\"object\":\"chat.completion.chunk\",\"created\":1749735006,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"jzs0tg1sv\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! How are you doing? \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-6adcf90a-2455-498f-8323-e2e338e80d80\",\"object\":\"chat.completion.chunk\",\"created\":1749735006,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5aqhxfxrv3kvg9by2hher\",\"usage\":{\"queue_time\":0.091109867,\"prompt_tokens\":921,\"prompt_time\":0.068135817,\"completion_tokens\":68,\"completion_time\":0.247272727,\"total_tokens\":989,\"total_time\":0.315408544}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-409e8d79-b4ab-454a-adbb-f3a72adc5c68\",\"object\":\"chat.completion.chunk\",\"created\":1752130909,\"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_01jzsj7wsvfwz8gnrva18n05gg\"}}\n\ndata: {\"id\":\"chatcmpl-409e8d79-b4ab-454a-adbb-f3a72adc5c68\",\"object\":\"chat.completion.chunk\",\"created\":1752130909,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"vp5d7gd8q\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! How are you doing? \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-409e8d79-b4ab-454a-adbb-f3a72adc5c68\",\"object\":\"chat.completion.chunk\",\"created\":1752130909,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzsj7wsvfwz8gnrva18n05gg\",\"usage\":{\"queue_time\":0.092505431,\"prompt_tokens\":917,\"prompt_time\":0.060087438,\"completion_tokens\":72,\"completion_time\":0.160716461,\"total_tokens\":989,\"total_time\":0.220803899}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_bcb2fc9b7ec7eb1ae370d9387dc7e505.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_2b98509c91ffaa3f4b775afdebef2dd1.json similarity index 59% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_bcb2fc9b7ec7eb1ae370d9387dc7e505.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_2b98509c91ffaa3f4b775afdebef2dd1.json index 8b96244767..84cf302485 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_bcb2fc9b7ec7eb1ae370d9387dc7e505.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_2b98509c91ffaa3f4b775afdebef2dd1.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-406505f7-519b-47de-80d3-dffcaf5df2ae\",\"object\":\"chat.completion.chunk\",\"created\":1749735006,\"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_01jxj5ar0fe75tkb4ehkv6rsmj\"}}\n\ndata: {\"id\":\"chatcmpl-406505f7-519b-47de-80d3-dffcaf5df2ae\",\"object\":\"chat.completion.chunk\",\"created\":1749735006,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"f49z9f6np\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-406505f7-519b-47de-80d3-dffcaf5df2ae\",\"object\":\"chat.completion.chunk\",\"created\":1749735006,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5ar0fe75tkb4ehkv6rsmj\",\"usage\":{\"queue_time\":0.09850561900000002,\"prompt_tokens\":937,\"prompt_time\":0.061384154,\"completion_tokens\":51,\"completion_time\":0.185454545,\"total_tokens\":988,\"total_time\":0.246838699}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-ccca6067-bd38-4c16-85a0-2faa593c31dc\",\"object\":\"chat.completion.chunk\",\"created\":1752130619,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz1xhfp0apqc2rr7qewwt\"}}\n\ndata: {\"id\":\"chatcmpl-ccca6067-bd38-4c16-85a0-2faa593c31dc\",\"object\":\"chat.completion.chunk\",\"created\":1752130619,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"6d2bt4xsv\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-ccca6067-bd38-4c16-85a0-2faa593c31dc\",\"object\":\"chat.completion.chunk\",\"created\":1752130619,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz1xhfp0apqc2rr7qewwt\",\"usage\":{\"queue_time\":0.042757260000000005,\"prompt_tokens\":933,\"prompt_time\":0.058546505,\"completion_tokens\":56,\"completion_time\":0.148834134,\"total_tokens\":989,\"total_time\":0.207380639}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_9e6d5cd399d444173556b9dc0afc3334.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_24ba9ad6b82850e51f9aeb27631974c1.json similarity index 59% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_9e6d5cd399d444173556b9dc0afc3334.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_24ba9ad6b82850e51f9aeb27631974c1.json index 35ae662185..54874015ad 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_9e6d5cd399d444173556b9dc0afc3334.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_24ba9ad6b82850e51f9aeb27631974c1.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-e3a3d75a-6a9b-4434-ab07-ae8d5556b602\",\"object\":\"chat.completion.chunk\",\"created\":1749735004,\"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_01jxj5apndfd7rp0qkwmvgk1k9\"}}\n\ndata: {\"id\":\"chatcmpl-e3a3d75a-6a9b-4434-ab07-ae8d5556b602\",\"object\":\"chat.completion.chunk\",\"created\":1749735005,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"j4wtzpwq7\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, updated content\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-e3a3d75a-6a9b-4434-ab07-ae8d5556b602\",\"object\":\"chat.completion.chunk\",\"created\":1749735005,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5apndfd7rp0qkwmvgk1k9\",\"usage\":{\"queue_time\":0.09943898600000001,\"prompt_tokens\":927,\"prompt_time\":0.087805571,\"completion_tokens\":29,\"completion_time\":0.123426203,\"total_tokens\":956,\"total_time\":0.211231774}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-5b2d6beb-e01b-4103-ae0e-b2184fa6617b\",\"object\":\"chat.completion.chunk\",\"created\":1752130618,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz10wfnyrsj0tpc2rgsa8\"}}\n\ndata: {\"id\":\"chatcmpl-5b2d6beb-e01b-4103-ae0e-b2184fa6617b\",\"object\":\"chat.completion.chunk\",\"created\":1752130618,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"tw51sve9h\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, updated content\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-5b2d6beb-e01b-4103-ae0e-b2184fa6617b\",\"object\":\"chat.completion.chunk\",\"created\":1752130618,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz10wfnyrsj0tpc2rgsa8\",\"usage\":{\"queue_time\":0.042126049,\"prompt_tokens\":923,\"prompt_time\":0.054451342,\"completion_tokens\":34,\"completion_time\":0.114269562,\"total_tokens\":957,\"total_time\":0.168720904}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_e1d72f9616d34022fba9ea219eb13748.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_64f592e51960d717cdbd7aa155ae6196.json similarity index 61% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_e1d72f9616d34022fba9ea219eb13748.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_64f592e51960d717cdbd7aa155ae6196.json index c83c679166..d233f48198 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_e1d72f9616d34022fba9ea219eb13748.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_64f592e51960d717cdbd7aa155ae6196.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-682c14cc-96f8-4138-9bba-165b02d7ccd9\",\"object\":\"chat.completion.chunk\",\"created\":1749735007,\"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_01jxj5asjbfdavajvbd5hhaj2g\"}}\n\ndata: {\"id\":\"chatcmpl-682c14cc-96f8-4138-9bba-165b02d7ccd9\",\"object\":\"chat.completion.chunk\",\"created\":1749735008,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"jjqknz2st\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-682c14cc-96f8-4138-9bba-165b02d7ccd9\",\"object\":\"chat.completion.chunk\",\"created\":1749735008,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5asjbfdavajvbd5hhaj2g\",\"usage\":{\"queue_time\":0.091396084,\"prompt_tokens\":919,\"prompt_time\":0.06833225,\"completion_tokens\":77,\"completion_time\":0.28,\"total_tokens\":996,\"total_time\":0.34833225}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-de4ca11f-3c68-40fa-86ba-ecf9acaa38cc\",\"object\":\"chat.completion.chunk\",\"created\":1752130620,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz30bf0y8wm75aj5t98z7\"}}\n\ndata: {\"id\":\"chatcmpl-de4ca11f-3c68-40fa-86ba-ecf9acaa38cc\",\"object\":\"chat.completion.chunk\",\"created\":1752130620,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"ajpqpcymb\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-de4ca11f-3c68-40fa-86ba-ecf9acaa38cc\",\"object\":\"chat.completion.chunk\",\"created\":1752130620,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz30bf0y8wm75aj5t98z7\",\"usage\":{\"queue_time\":0.042423847,\"prompt_tokens\":915,\"prompt_time\":0.07108869,\"completion_tokens\":78,\"completion_time\":0.172519291,\"total_tokens\":993,\"total_time\":0.243607981}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_bd11c0a3efe0e2b04a0133c6ca73a5cd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_9ae98cae168d1714dcdd12abbf4ab7dc.json similarity index 52% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_bd11c0a3efe0e2b04a0133c6ca73a5cd.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_9ae98cae168d1714dcdd12abbf4ab7dc.json index c2f05be482..e372a193cd 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_bd11c0a3efe0e2b04a0133c6ca73a5cd.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_9ae98cae168d1714dcdd12abbf4ab7dc.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the second block to german (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-486ceb54-7aac-4ab4-b8ac-483624e0c0df\",\"object\":\"chat.completion.chunk\",\"created\":1749735005,\"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_01jxj5aq28fxrtkxdwwp1e60h0\"}}\n\ndata: {\"id\":\"chatcmpl-486ceb54-7aac-4ab4-b8ac-483624e0c0df\",\"object\":\"chat.completion.chunk\",\"created\":1749735005,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"x1wmn3w6d\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eWie geht es dir?\\\\u003c/strong\\\\u003e \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eDieser Text ist blau!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-486ceb54-7aac-4ab4-b8ac-483624e0c0df\",\"object\":\"chat.completion.chunk\",\"created\":1749735005,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5aq28fxrtkxdwwp1e60h0\",\"usage\":{\"queue_time\":0.093027908,\"prompt_tokens\":926,\"prompt_time\":0.067121532,\"completion_tokens\":80,\"completion_time\":0.290909091,\"total_tokens\":1006,\"total_time\":0.358030623}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-36711cc7-80ef-4890-88f2-a26682e11b7c\",\"object\":\"chat.completion.chunk\",\"created\":1752131346,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzsjn7ssfe18jdyr51nn2jmv\"}}\n\ndata: {\"id\":\"chatcmpl-36711cc7-80ef-4890-88f2-a26682e11b7c\",\"object\":\"chat.completion.chunk\",\"created\":1752131346,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"d9pvtbd5t\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eWie geht es dir?\\\\u003c/strong\\\\u003e \\\\u003cspan data-text-color=\\\\\\\"blue\\\\\\\"\\\\u003eDieser Text ist blau!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-36711cc7-80ef-4890-88f2-a26682e11b7c\",\"object\":\"chat.completion.chunk\",\"created\":1752131346,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzsjn7ssfe18jdyr51nn2jmv\",\"usage\":{\"queue_time\":0.049715931,\"prompt_tokens\":925,\"prompt_time\":0.054214697,\"completion_tokens\":80,\"completion_time\":0.198298875,\"total_tokens\":1005,\"total_time\":0.252513572}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_c865fea79947e8f5885f8c7ebc7dd91a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_42509ec379b9798b007c4481b1b65118.json similarity index 59% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_c865fea79947e8f5885f8c7ebc7dd91a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_42509ec379b9798b007c4481b1b65118.json index 7c59a176f4..5963a50f83 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_c865fea79947e8f5885f8c7ebc7dd91a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_42509ec379b9798b007c4481b1b65118.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-d18c230a-3e28-4c60-bee6-afa8a4288bbb\",\"object\":\"chat.completion.chunk\",\"created\":1749735007,\"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_01jxj5artce76a9vcb8tk4957t\"}}\n\ndata: {\"id\":\"chatcmpl-d18c230a-3e28-4c60-bee6-afa8a4288bbb\",\"object\":\"chat.completion.chunk\",\"created\":1749735007,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"8vv814w4a\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003e\\\\u003cstrong\\\\u003eHello, world!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d18c230a-3e28-4c60-bee6-afa8a4288bbb\",\"object\":\"chat.completion.chunk\",\"created\":1749735007,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5artce76a9vcb8tk4957t\",\"usage\":{\"queue_time\":0.098458649,\"prompt_tokens\":917,\"prompt_time\":0.07098885,\"completion_tokens\":36,\"completion_time\":0.130909091,\"total_tokens\":953,\"total_time\":0.201897941}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-aefc4ffa-8eb6-4f0d-b413-4dc2ed788b6a\",\"object\":\"chat.completion.chunk\",\"created\":1752130619,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz2f9f0yasbttkw9j0fj0\"}}\n\ndata: {\"id\":\"chatcmpl-aefc4ffa-8eb6-4f0d-b413-4dc2ed788b6a\",\"object\":\"chat.completion.chunk\",\"created\":1752130620,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"mj437np11\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003e\\\\u003cstrong\\\\u003eHello, world!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-aefc4ffa-8eb6-4f0d-b413-4dc2ed788b6a\",\"object\":\"chat.completion.chunk\",\"created\":1752130620,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz2f9f0yasbttkw9j0fj0\",\"usage\":{\"queue_time\":0.04236147900000001,\"prompt_tokens\":913,\"prompt_time\":0.05987015,\"completion_tokens\":37,\"completion_time\":0.111887409,\"total_tokens\":950,\"total_time\":0.171757559}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_e155e7bf26070976e31928b82bb13fbc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_4054e8af99647ab39ef82cbd2fa546c9.json similarity index 59% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_e155e7bf26070976e31928b82bb13fbc.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_4054e8af99647ab39ef82cbd2fa546c9.json index a43bba8ad9..1fff511c3b 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_e155e7bf26070976e31928b82bb13fbc.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_4054e8af99647ab39ef82cbd2fa546c9.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-5243d65c-bba7-4ecb-9321-4efb979b5d62\",\"object\":\"chat.completion.chunk\",\"created\":1749735006,\"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_01jxj5arcsfxttkzyakefcg90j\"}}\n\ndata: {\"id\":\"chatcmpl-5243d65c-bba7-4ecb-9321-4efb979b5d62\",\"object\":\"chat.completion.chunk\",\"created\":1749735006,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"0cryb8stx\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cstrong\\\\u003eworld!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-5243d65c-bba7-4ecb-9321-4efb979b5d62\",\"object\":\"chat.completion.chunk\",\"created\":1749735006,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5arcsfxttkzyakefcg90j\",\"usage\":{\"queue_time\":0.092388885,\"prompt_tokens\":924,\"prompt_time\":0.128782737,\"completion_tokens\":33,\"completion_time\":0.12,\"total_tokens\":957,\"total_time\":0.248782737}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-77340a7a-97c6-4a3d-a179-e314df4b002a\",\"object\":\"chat.completion.chunk\",\"created\":1752130619,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz26rf0xtrk7y616r8x5n\"}}\n\ndata: {\"id\":\"chatcmpl-77340a7a-97c6-4a3d-a179-e314df4b002a\",\"object\":\"chat.completion.chunk\",\"created\":1752130619,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"fgz0hbp9p\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cstrong\\\\u003eworld!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-77340a7a-97c6-4a3d-a179-e314df4b002a\",\"object\":\"chat.completion.chunk\",\"created\":1752130619,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz26rf0xtrk7y616r8x5n\",\"usage\":{\"queue_time\":0.043332941,\"prompt_tokens\":920,\"prompt_time\":0.057599895,\"completion_tokens\":33,\"completion_time\":0.101691727,\"total_tokens\":953,\"total_time\":0.159291622}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_54ec8515dd6ab214d8b92c5cf4f09529.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_e16698998bf1a04cb9538d79a1ceff2c.json similarity index 52% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_54ec8515dd6ab214d8b92c5cf4f09529.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_e16698998bf1a04cb9538d79a1ceff2c.json index f7297b321e..74a8e9e493 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_54ec8515dd6ab214d8b92c5cf4f09529.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_e16698998bf1a04cb9538d79a1ceff2c.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-f3df63a8-471f-440a-9998-58748e3627a8\",\"object\":\"chat.completion.chunk\",\"created\":1749735003,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jxj5anp6e709vt4jznn94x9k\"}}\n\ndata: {\"id\":\"chatcmpl-f3df63a8-471f-440a-9998-58748e3627a8\",\"object\":\"chat.completion.chunk\",\"created\":1749735004,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"0vbb4xdh2\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f3df63a8-471f-440a-9998-58748e3627a8\",\"object\":\"chat.completion.chunk\",\"created\":1749735004,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5anp6e709vt4jznn94x9k\",\"usage\":{\"queue_time\":0.09688751899999999,\"prompt_tokens\":760,\"prompt_time\":0.05287177,\"completion_tokens\":31,\"completion_time\":0.115326856,\"total_tokens\":791,\"total_time\":0.168198626}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-7c2502be-1e21-43d5-8401-4439121b57da\",\"object\":\"chat.completion.chunk\",\"created\":1752130617,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz083f0x8btebth4hkryv\"}}\n\ndata: {\"id\":\"chatcmpl-7c2502be-1e21-43d5-8401-4439121b57da\",\"object\":\"chat.completion.chunk\",\"created\":1752130617,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"9pmpqxhps\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-7c2502be-1e21-43d5-8401-4439121b57da\",\"object\":\"chat.completion.chunk\",\"created\":1752130617,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz083f0x8btebth4hkryv\",\"usage\":{\"queue_time\":0.042362349,\"prompt_tokens\":756,\"prompt_time\":0.04508662,\"completion_tokens\":31,\"completion_time\":0.100243164,\"total_tokens\":787,\"total_time\":0.145329784}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_ec7bd4074c354be223256a9d0ab17e64.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_12667c1a7b080c02776120c0a85b9cd9.json similarity index 51% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_ec7bd4074c354be223256a9d0ab17e64.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_12667c1a7b080c02776120c0a85b9cd9.json index f52c4e10d1..75b1190865 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_ec7bd4074c354be223256a9d0ab17e64.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_12667c1a7b080c02776120c0a85b9cd9.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-40eb468d-1d3c-4755-95dd-479fff6bb6f0\",\"object\":\"chat.completion.chunk\",\"created\":1749735009,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jxj5av18e7z9p98177y3fn59\"}}\n\ndata: {\"id\":\"chatcmpl-40eb468d-1d3c-4755-95dd-479fff6bb6f0\",\"object\":\"chat.completion.chunk\",\"created\":1749735009,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"43a3x3h4y\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-40eb468d-1d3c-4755-95dd-479fff6bb6f0\",\"object\":\"chat.completion.chunk\",\"created\":1749735009,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5av18e7z9p98177y3fn59\",\"usage\":{\"queue_time\":0.136583484,\"prompt_tokens\":706,\"prompt_time\":0.053731224,\"completion_tokens\":66,\"completion_time\":0.24,\"total_tokens\":772,\"total_time\":0.293731224}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-f39d9ce3-f4a0-4515-9300-e08e52075295\",\"object\":\"chat.completion.chunk\",\"created\":1752130621,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz424fp08gthsg0z1hm29\"}}\n\ndata: {\"id\":\"chatcmpl-f39d9ce3-f4a0-4515-9300-e08e52075295\",\"object\":\"chat.completion.chunk\",\"created\":1752130621,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"cb4zn9zph\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f39d9ce3-f4a0-4515-9300-e08e52075295\",\"object\":\"chat.completion.chunk\",\"created\":1752130621,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz424fp08gthsg0z1hm29\",\"usage\":{\"queue_time\":0.041717254999999995,\"prompt_tokens\":702,\"prompt_time\":0.043687106,\"completion_tokens\":65,\"completion_time\":0.133650898,\"total_tokens\":767,\"total_time\":0.177338004}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_a935b00dc3276d6713bffbfb1fdf211e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_4f67ef168fbf2021f1b78fb11b22f568.json similarity index 59% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_a935b00dc3276d6713bffbfb1fdf211e.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_4f67ef168fbf2021f1b78fb11b22f568.json index 0c7d2dc86b..e1ccbe536f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_a935b00dc3276d6713bffbfb1fdf211e.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_4f67ef168fbf2021f1b78fb11b22f568.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-d8d2deea-91ae-4ea3-a32a-6bd8969ecd14\",\"object\":\"chat.completion.chunk\",\"created\":1749735004,\"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_01jxj5apaqe72s98ssh63fg0rn\"}}\n\ndata: {\"id\":\"chatcmpl-d8d2deea-91ae-4ea3-a32a-6bd8969ecd14\",\"object\":\"chat.completion.chunk\",\"created\":1749735004,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"1cv889807\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eWhat's up, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d8d2deea-91ae-4ea3-a32a-6bd8969ecd14\",\"object\":\"chat.completion.chunk\",\"created\":1749735004,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5apaqe72s98ssh63fg0rn\",\"usage\":{\"queue_time\":0.092581626,\"prompt_tokens\":931,\"prompt_time\":0.071538603,\"completion_tokens\":33,\"completion_time\":0.12,\"total_tokens\":964,\"total_time\":0.191538603}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-d4cb3e41-02f1-4d9e-a3f9-0f96548bda9b\",\"object\":\"chat.completion.chunk\",\"created\":1752130618,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz0rjf0xb1axtxvwqzhfh\"}}\n\ndata: {\"id\":\"chatcmpl-d4cb3e41-02f1-4d9e-a3f9-0f96548bda9b\",\"object\":\"chat.completion.chunk\",\"created\":1752130618,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"a3ewmmnyq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eWhat's up, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d4cb3e41-02f1-4d9e-a3f9-0f96548bda9b\",\"object\":\"chat.completion.chunk\",\"created\":1752130618,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz0rjf0xb1axtxvwqzhfh\",\"usage\":{\"queue_time\":0.043360285,\"prompt_tokens\":927,\"prompt_time\":0.054388113,\"completion_tokens\":33,\"completion_time\":0.122948032,\"total_tokens\":960,\"total_time\":0.177336145}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_21d1130a166f73bca224130b84ed37c4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_f14e429b4f85b7586942a94000a44f21.json similarity index 59% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_21d1130a166f73bca224130b84ed37c4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_f14e429b4f85b7586942a94000a44f21.json index cc57054dc0..830d9ffb9a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_21d1130a166f73bca224130b84ed37c4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_f14e429b4f85b7586942a94000a44f21.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-c4f1821e-3705-4b5a-b70a-0c98e7b3d2d8\",\"object\":\"chat.completion.chunk\",\"created\":1749735004,\"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_01jxj5ap0ee70rgyqh0t1syb47\"}}\n\ndata: {\"id\":\"chatcmpl-c4f1821e-3705-4b5a-b70a-0c98e7b3d2d8\",\"object\":\"chat.completion.chunk\",\"created\":1749735004,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"r44r9915a\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eHello, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c4f1821e-3705-4b5a-b70a-0c98e7b3d2d8\",\"object\":\"chat.completion.chunk\",\"created\":1749735004,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jxj5ap0ee70rgyqh0t1syb47\",\"usage\":{\"queue_time\":0.09159241199999998,\"prompt_tokens\":919,\"prompt_time\":0.067053834,\"completion_tokens\":30,\"completion_time\":0.112853757,\"total_tokens\":949,\"total_time\":0.179907591}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-a7c6474c-7fe5-4e3a-bc00-d942c89d7377\",\"object\":\"chat.completion.chunk\",\"created\":1752130617,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jzshz0fafnxvfnd79bwbbn9r\"}}\n\ndata: {\"id\":\"chatcmpl-a7c6474c-7fe5-4e3a-bc00-d942c89d7377\",\"object\":\"chat.completion.chunk\",\"created\":1752130618,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"cnr9ahps9\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eHello, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-a7c6474c-7fe5-4e3a-bc00-d942c89d7377\",\"object\":\"chat.completion.chunk\",\"created\":1752130618,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c65b1b4a5f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jzshz0fafnxvfnd79bwbbn9r\",\"usage\":{\"queue_time\":0.042571701,\"prompt_tokens\":915,\"prompt_time\":0.05376931,\"completion_tokens\":34,\"completion_time\":0.109333459,\"total_tokens\":949,\"total_time\":0.163102769}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_8798a9655a7eb7a651bb81f5f811fc60.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_c9e281ea445a93fbc84005fa8a92d07e.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_8798a9655a7eb7a651bb81f5f811fc60.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_c9e281ea445a93fbc84005fa8a92d07e.json index c86a29ed6d..1d7a69ceba 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_8798a9655a7eb7a651bb81f5f811fc60.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_c9e281ea445a93fbc84005fa8a92d07e.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHzsXure0zEeVpyGSdzbhilnpBB\",\n \"object\": \"chat.completion\",\n \"created\": 1749734987,\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_2qujJrLbm204WVX1ciAfUIot\",\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\": 658,\n \"completion_tokens\": 33,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfV3zoEUQDMHTgq2daXMNIxCqPIe\",\n \"object\": \"chat.completion\",\n \"created\": 1752130609,\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_VTv4px7IN4JezJM9QCKmQ8wa\",\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\": 658,\n \"completion_tokens\": 33,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_001ea299cc5ab0754d17884094fa9d86.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_6f06b0c532060f9a0c1c0b2f64f2b6ab.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_001ea299cc5ab0754d17884094fa9d86.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_6f06b0c532060f9a0c1c0b2f64f2b6ab.json index b0ccf5cdfc..2db94ebf5a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_001ea299cc5ab0754d17884094fa9d86.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_6f06b0c532060f9a0c1c0b2f64f2b6ab.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHy1SdvhxpHZvkkbWwv7bBebVxR\",\n \"object\": \"chat.completion\",\n \"created\": 1749734986,\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_uhieOlUMWfilcLitiZI0WzCU\",\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\": 652,\n \"completion_tokens\": 31,\n \"total_tokens\": 683,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfV2UWPdF3w8eJCGjJzYkRrQfCUN\",\n \"object\": \"chat.completion\",\n \"created\": 1752130608,\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_z8GxRxuR62BVTry05d0Bj6zC\",\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\": 652,\n \"completion_tokens\": 31,\n \"total_tokens\": 683,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_3b7f9df9f7701d51e2ccf274e5280a7d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_f87724ae16fe199bd8fb1ac207a3ab99.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_3b7f9df9f7701d51e2ccf274e5280a7d.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_f87724ae16fe199bd8fb1ac207a3ab99.json index d1d81b8f06..31afd6ed92 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_3b7f9df9f7701d51e2ccf274e5280a7d.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_f87724ae16fe199bd8fb1ac207a3ab99.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcI1gI8AV6TAqDFvtm77SzcqmF7x\",\n \"object\": \"chat.completion\",\n \"created\": 1749734989,\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_vMkQr8mcoFiFXlVNcEXG7hKW\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 543,\n \"completion_tokens\": 26,\n \"total_tokens\": 569,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfV5giIBr5ONSi7UPlBbbXpOl4ST\",\n \"object\": \"chat.completion\",\n \"created\": 1752130611,\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_mDWgZEcCJy7QWTJnaCcTl0Ko\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 543,\n \"completion_tokens\": 26,\n \"total_tokens\": 569,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_3b9c9ee90eacd058e510ca1c82cbd554.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_85ee68d4daa7ddab518c19afcd02cb44.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_3b9c9ee90eacd058e510ca1c82cbd554.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_85ee68d4daa7ddab518c19afcd02cb44.json index 6ab2f5ad75..6ce4b56c74 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_3b9c9ee90eacd058e510ca1c82cbd554.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_85ee68d4daa7ddab518c19afcd02cb44.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcI2nsiP66ngWmFsYz9EVL2tlB6K\",\n \"object\": \"chat.completion\",\n \"created\": 1749734990,\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_NDPPktzJshsDecmFJ0YZcO6Y\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 545,\n \"completion_tokens\": 27,\n \"total_tokens\": 572,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfV6D9sTOqGYstLRN6EHlFheHJ7A\",\n \"object\": \"chat.completion\",\n \"created\": 1752130612,\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_gbzIyaMGH212mAI9ceL0d2Zk\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 545,\n \"completion_tokens\": 27,\n \"total_tokens\": 572,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_2e588074658964fdee8f372a25645e39.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_babb54324affa4adb9249cdae14cf222.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_2e588074658964fdee8f372a25645e39.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_babb54324affa4adb9249cdae14cf222.json index 036aa3a0ba..0e8c645d48 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_2e588074658964fdee8f372a25645e39.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_babb54324affa4adb9249cdae14cf222.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHubb6jvHcQqJWwzoml9FZqJKqG\",\n \"object\": \"chat.completion\",\n \"created\": 1749734982,\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_DA5xtTAB5ZruQCgBYKgq5s2b\",\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\": 650,\n \"completion_tokens\": 46,\n \"total_tokens\": 696,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfUzXojvsPnUFIqQHjsETqBAPFPR\",\n \"object\": \"chat.completion\",\n \"created\": 1752130605,\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_kgfcjvr1BnhSc2HjxQpUT6Pw\",\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\": 650,\n \"completion_tokens\": 46,\n \"total_tokens\": 696,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_8aa8c7ee6f4c17a92493df542b131069.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_8c6a9aa2df797ab1a789805eb44c20c6.json similarity index 71% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_8aa8c7ee6f4c17a92493df542b131069.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_8c6a9aa2df797ab1a789805eb44c20c6.json index 768ef729ff..bdc5a4781e 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_8aa8c7ee6f4c17a92493df542b131069.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_8c6a9aa2df797ab1a789805eb44c20c6.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHeEohd7Bir7AZDcmc0u9C1WlyO\",\n \"object\": \"chat.completion\",\n \"created\": 1749734966,\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_9lite6j2utp4jUDY4p7nPwa9\",\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\": 641,\n \"completion_tokens\": 27,\n \"total_tokens\": 668,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfUpYusRisicmlIl1D5v1LtOSMw2\",\n \"object\": \"chat.completion\",\n \"created\": 1752130595,\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_eGqRbOAQ0cABn37YLD8kYeVe\",\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\": 641,\n \"completion_tokens\": 27,\n \"total_tokens\": 668,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_7c37aad8ce27e926dc486960a90f35eb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_3308e5066e651a6abeb10e26cd62b8c2.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_7c37aad8ce27e926dc486960a90f35eb.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_3308e5066e651a6abeb10e26cd62b8c2.json index d0bf3ff3ba..0161ed9c83 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_7c37aad8ce27e926dc486960a90f35eb.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_3308e5066e651a6abeb10e26cd62b8c2.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHoJJjYKNwD75M72vdTLMEvpgBq\",\n \"object\": \"chat.completion\",\n \"created\": 1749734976,\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_EmlgrXIW8WuSAoklTCZLyO1q\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 643,\n \"completion_tokens\": 66,\n \"total_tokens\": 709,\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_a288987b44\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfUvr51O0Y0DIMhEz2Y1kYW4WLdi\",\n \"object\": \"chat.completion\",\n \"created\": 1752130601,\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_oISDuKRXgWMDP0omEC3rTumI\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 643,\n \"completion_tokens\": 66,\n \"total_tokens\": 709,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_a9fa6b0be7fae1d70499aa6ecfea6704.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_5b43e33507a6bc64943c2383991ad7d4.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_a9fa6b0be7fae1d70499aa6ecfea6704.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_5b43e33507a6bc64943c2383991ad7d4.json index 67e2751fad..7270b23983 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_a9fa6b0be7fae1d70499aa6ecfea6704.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_5b43e33507a6bc64943c2383991ad7d4.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHpaF7uKlTEF9GYexdxDxojvKwE\",\n \"object\": \"chat.completion\",\n \"created\": 1749734977,\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_OGZkJgIpnQKFAbFQlNcxV36j\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 659,\n \"completion_tokens\": 49,\n \"total_tokens\": 708,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfUxNDxBSz90uYoQWZZaz5SQMmOY\",\n \"object\": \"chat.completion\",\n \"created\": 1752130603,\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_zJ8tX850ogvWvcXWrGoAqdNH\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 659,\n \"completion_tokens\": 49,\n \"total_tokens\": 708,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_4d4299b8044479fe9e15a4a168707806.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_b9c728e7fe649e31114138d69a0b69c7.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_4d4299b8044479fe9e15a4a168707806.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_b9c728e7fe649e31114138d69a0b69c7.json index d8f8620f7d..0a0f2a57d3 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_4d4299b8044479fe9e15a4a168707806.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_b9c728e7fe649e31114138d69a0b69c7.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHlJRL5zw8fn39N2IdfFrNfE83J\",\n \"object\": \"chat.completion\",\n \"created\": 1749734973,\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_DJW3hVRD6IKt0veNAtDOUf7e\",\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\": 649,\n \"completion_tokens\": 27,\n \"total_tokens\": 676,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfZrebQ6RlwN2h5a63Ui6x4SpgBi\",\n \"object\": \"chat.completion\",\n \"created\": 1752130907,\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_M1bKdJG900OjyF2qH0mdKoS7\",\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\": 649,\n \"completion_tokens\": 27,\n \"total_tokens\": 676,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_c6fa894a14f6be81fb568283e4724af9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_6fb8402fb1c0ef42821646b7ae01a6f8.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_c6fa894a14f6be81fb568283e4724af9.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_6fb8402fb1c0ef42821646b7ae01a6f8.json index 495c11e0d2..19d70afe70 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_c6fa894a14f6be81fb568283e4724af9.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_6fb8402fb1c0ef42821646b7ae01a6f8.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHwBaaZHFkfhg7lUaOcCO9J54FB\",\n \"object\": \"chat.completion\",\n \"created\": 1749734984,\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_nE9zyIWLfXJ1629897DstBeo\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 641,\n \"completion_tokens\": 71,\n \"total_tokens\": 712,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfV0uDLeHjCTNxJ6bwxssRbzNU7b\",\n \"object\": \"chat.completion\",\n \"created\": 1752130606,\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_2gcvWX8D6qm581fFLcKwFIAA\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 641,\n \"completion_tokens\": 71,\n \"total_tokens\": 712,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_aa627d12493a30d6fa1bbf6d282b6ecd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_39a7f24d933099914037252cc9e02645.json similarity index 60% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_aa627d12493a30d6fa1bbf6d282b6ecd.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_39a7f24d933099914037252cc9e02645.json index 40443bb0e2..b9de46bfb7 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_aa627d12493a30d6fa1bbf6d282b6ecd.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_39a7f24d933099914037252cc9e02645.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the second block to german (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHmqAHV9wM3PPeIuuMVK7alMhET\",\n \"object\": \"chat.completion\",\n \"created\": 1749734974,\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_gEWruFBB42OUsIW0xBDJd7mZ\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 648,\n \"completion_tokens\": 72,\n \"total_tokens\": 720,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfgKW6pmqrHlBVUBaIdAdaLQwFpZ\",\n \"object\": \"chat.completion\",\n \"created\": 1752131308,\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_Ap81kZbLyB6usfA0WV8bUMCY\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 651,\n \"completion_tokens\": 72,\n \"total_tokens\": 723,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_711e7638278935cce832085d8cce0abc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_cecd6722d457eb6bb4b1231e28c61b64.json similarity index 71% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_711e7638278935cce832085d8cce0abc.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_cecd6722d457eb6bb4b1231e28c61b64.json index c0186e82af..1c32f07172 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_711e7638278935cce832085d8cce0abc.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_cecd6722d457eb6bb4b1231e28c61b64.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHtNuR0f7s62B2kPWwjhyzfb5wc\",\n \"object\": \"chat.completion\",\n \"created\": 1749734981,\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_hVYn1P27En0hFFi0Mrp6IrnS\",\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\": 639,\n \"completion_tokens\": 30,\n \"total_tokens\": 669,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfUzMBYQ9AbSab39L5dJTBaLSNZS\",\n \"object\": \"chat.completion\",\n \"created\": 1752130605,\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_EiZ1JNRjWHTxa7CuR6fje1Mi\",\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\": 639,\n \"completion_tokens\": 30,\n \"total_tokens\": 669,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_739768c550cdc9eb5af10dbacc7c6d22.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_ca614a9ed0162e6f24732e67e6076cb1.json similarity index 71% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_739768c550cdc9eb5af10dbacc7c6d22.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_ca614a9ed0162e6f24732e67e6076cb1.json index e66f9bff75..80f9f36a16 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_739768c550cdc9eb5af10dbacc7c6d22.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_ca614a9ed0162e6f24732e67e6076cb1.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHrrv6JtF26qY2zEnSTzMvhL6f9\",\n \"object\": \"chat.completion\",\n \"created\": 1749734979,\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_xv3xHeGsoRtI6MR7cflMbCCP\",\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\": 646,\n \"completion_tokens\": 31,\n \"total_tokens\": 677,\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_a288987b44\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfUyb3O5hH8k9XwdrP94sTObY8Gd\",\n \"object\": \"chat.completion\",\n \"created\": 1752130604,\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_HcekCvYWo1Mik004oceaAh6X\",\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\": 646,\n \"completion_tokens\": 31,\n \"total_tokens\": 677,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_83bf8aa261516bf197d1391294bbcb06.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1d9ae8d2cabb0ab2d3425b42da65f9aa.json similarity index 68% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_83bf8aa261516bf197d1391294bbcb06.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1d9ae8d2cabb0ab2d3425b42da65f9aa.json index 34729d7121..ec21a4d1e0 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_83bf8aa261516bf197d1391294bbcb06.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1d9ae8d2cabb0ab2d3425b42da65f9aa.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHih0K4vRotKfQTx7uSwNm05RKp\",\n \"object\": \"chat.completion\",\n \"created\": 1749734970,\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_jlB5Dt981zT7rzgas2ObHtyq\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 486,\n \"completion_tokens\": 25,\n \"total_tokens\": 511,\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_a288987b44\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfUqFaDOzJikUxk9pO0VJo8MNSFL\",\n \"object\": \"chat.completion\",\n \"created\": 1752130596,\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_lEQMBzEYQt7baoHlrSIImCxU\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 486,\n \"completion_tokens\": 25,\n \"total_tokens\": 511,\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_07871e2ad8\"\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_5aa207db4b8600962363d2352bf0b1c4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_c329ee96e44a6acec8c490bfe9036c3c.json similarity index 65% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_5aa207db4b8600962363d2352bf0b1c4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_c329ee96e44a6acec8c490bfe9036c3c.json index c68a5497ef..a87bee39b5 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_5aa207db4b8600962363d2352bf0b1c4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_c329ee96e44a6acec8c490bfe9036c3c.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcI05MF7pmTrNFBvII7F9wDRFRc2\",\n \"object\": \"chat.completion\",\n \"created\": 1749734988,\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_OcEUN0Z7voNhGeEexZwQGuhx\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 432,\n \"completion_tokens\": 55,\n \"total_tokens\": 487,\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_a288987b44\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfV3F9r7tmQZGBoHVYnWfAlixucp\",\n \"object\": \"chat.completion\",\n \"created\": 1752130609,\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_qeqQADkdvIbCQ1n3rHUAmvM6\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 432,\n \"completion_tokens\": 55,\n \"total_tokens\": 487,\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_07871e2ad8\"\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_12e64702225f7eb521a176feffbdde9a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_99c94387729dc443ea9a142027ae75a1.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_12e64702225f7eb521a176feffbdde9a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_99c94387729dc443ea9a142027ae75a1.json index 733c1034a3..c0e0b41c49 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_12e64702225f7eb521a176feffbdde9a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_99c94387729dc443ea9a142027ae75a1.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHkLr8GH0FVzui3iBpTjSma1zml\",\n \"object\": \"chat.completion\",\n \"created\": 1749734972,\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_KiGjEG4236L0WSOT5fLQO5Aq\",\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\": 652,\n \"completion_tokens\": 30,\n \"total_tokens\": 682,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfUsZXaBfWJBxyLNE7vGGx3EQEaM\",\n \"object\": \"chat.completion\",\n \"created\": 1752130598,\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_x7rpgmYM9EAkw9mU6bA0HUdB\",\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\": 652,\n \"completion_tokens\": 30,\n \"total_tokens\": 682,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_b81e29ddb0de05a668236685bd2df42c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_9d69f7aa4a1a514ddb293bfae46db69d.json similarity index 71% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_b81e29ddb0de05a668236685bd2df42c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_9d69f7aa4a1a514ddb293bfae46db69d.json index f04f627cc7..6449b526f4 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_b81e29ddb0de05a668236685bd2df42c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_9d69f7aa4a1a514ddb293bfae46db69d.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}]}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BhcHj3vPo81uwMaxdfU7EwJqLb4oi\",\n \"object\": \"chat.completion\",\n \"created\": 1749734971,\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_yAeSWVZRS4YPgm4A2ZpBhApj\",\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\": 641,\n \"completion_tokens\": 28,\n \"total_tokens\": 669,\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_07871e2ad8\"\n}\n", + "body": "{\n \"id\": \"chatcmpl-BrfUrihJegyxpkOHhTmSdaOFSd459\",\n \"object\": \"chat.completion\",\n \"created\": 1752130597,\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_6HydaHZtZfmHZb800N7hwxrD\",\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\": 641,\n \"completion_tokens\": 28,\n \"total_tokens\": 669,\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\": null\n}\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_99fc53184b728115e2c9bf977d44addb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_99fc53184b728115e2c9bf977d44addb.json new file mode 100644 index 0000000000..5e922bdefb --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_99fc53184b728115e2c9bf977d44addb.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_72q9AMpdpsTOteJBC7bSqjug\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hi\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" the\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUdFuejUfAtLG22VWcmpNyvr0QH\",\"object\":\"chat.completion.chunk\",\"created\":1752130583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_f48c2d1d72f4c3514c346629fb7f4d0d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_f48c2d1d72f4c3514c346629fb7f4d0d.json deleted file mode 100644 index a430515f1e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_f48c2d1d72f4c3514c346629fb7f4d0d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_TUs6AO1BckMTFvz9gMGo2R4J\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hi\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" the\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHBAn7MF7p1x1ZLkrTWj0klfNtZ\",\"object\":\"chat.completion.chunk\",\"created\":1749734937,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_c357b571feb374378ba1b288c39b6c31.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_c357b571feb374378ba1b288c39b6c31.json deleted file mode 100644 index 640b08cc0e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_c357b571feb374378ba1b288c39b6c31.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_yWQKc6HFEgUrWOQ1b0mt98i7\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH9uPvGLxrPfajdrPJ4Gjc1uHuR\",\"object\":\"chat.completion.chunk\",\"created\":1749734935,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_ec6e45525b18ba57e7669697631ed856.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_ec6e45525b18ba57e7669697631ed856.json new file mode 100644 index 0000000000..9693cef2a0 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_ec6e45525b18ba57e7669697631ed856.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_r6CkcyDe52zSQq5ZHd2sRek1\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUb9m3uMG5d1OV4eWf8AzfGwoyI\",\"object\":\"chat.completion.chunk\",\"created\":1752130581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_69e8bfa87ec2c7377f0f3e5bec154a35.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_69e8bfa87ec2c7377f0f3e5bec154a35.json new file mode 100644 index 0000000000..2af8abe69f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_69e8bfa87ec2c7377f0f3e5bec154a35.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_xsKaeaoubL0agw3I1sAowFrD\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"APP\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"LES\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUfEHXJnRp80jxcf3moFZxMuvv6\",\"object\":\"chat.completion.chunk\",\"created\":1752130585,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_782caee9bbb515bfdae481d31ea48e48.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_782caee9bbb515bfdae481d31ea48e48.json deleted file mode 100644 index 7c23951088..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_782caee9bbb515bfdae481d31ea48e48.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_URBuBOSniH9MZqqp0ixzLoWS\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"APP\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"LES\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHDjwDWILG9LDooc9fWYuTwDms2\",\"object\":\"chat.completion.chunk\",\"created\":1749734939,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_4fa129b1c39dce035ef12c29e733d88f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_4fa129b1c39dce035ef12c29e733d88f.json new file mode 100644 index 0000000000..227600f005 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_4fa129b1c39dce035ef12c29e733d88f.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_KFPDnPza8L83WWF0dbBzFC4H\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">I\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" NEED\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" TO\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" BUY\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUgGiWF3dhBnRJWLhYBkfGq232p\",\"object\":\"chat.completion.chunk\",\"created\":1752130586,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_92e8df7af02866607d407a52926d4f52.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_92e8df7af02866607d407a52926d4f52.json deleted file mode 100644 index f35e7e1bdb..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_92e8df7af02866607d407a52926d4f52.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_s4RcOhhatFUfUs3DTTskZ7VX\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">I\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" NEED\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" TO\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" BUY\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHEVmMeaN0KkM3C1jsSjt8SrqHu\",\"object\":\"chat.completion.chunk\",\"created\":1749734940,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_110023b0bf33e516b42bee6f23b6a840.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_110023b0bf33e516b42bee6f23b6a840.json new file mode 100644 index 0000000000..d3bdca4e76 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_110023b0bf33e516b42bee6f23b6a840.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_NmyCXWhrRSr3UguKehiMlNyN\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfZpidOlLS8AAflQJ2Hj97k0LFxM\",\"object\":\"chat.completion.chunk\",\"created\":1752130905,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_69dfced69472e5cf7789a98b3ccbbdd8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_69dfced69472e5cf7789a98b3ccbbdd8.json deleted file mode 100644 index ea1d05bd81..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_69dfced69472e5cf7789a98b3ccbbdd8.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_aUnPtC9f5jr92BZ4wt2EwynL\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH4B6ZoeXHq7dh7h7UGwywM7xTD\",\"object\":\"chat.completion.chunk\",\"created\":1749734930,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_3ea83b592a9e001f52872db06794772f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_3ea83b592a9e001f52872db06794772f.json new file mode 100644 index 0000000000..3ee98c753f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_3ea83b592a9e001f52872db06794772f.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_UKKDOSc1oMBG4C4j57rmlque\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Welt\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUMwCxFkyJ1fbrZJtfm90vyIU6J\",\"object\":\"chat.completion.chunk\",\"created\":1752130566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_f5d03fb0433b5e5b912f40dbffd9f462.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_f5d03fb0433b5e5b912f40dbffd9f462.json deleted file mode 100644 index c36029a14a..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_f5d03fb0433b5e5b912f40dbffd9f462.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_2DaOJPriLB8Kmc13f0zn6Bsl\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Welt\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGnLghCmp7qJAa5wDYPAR4tlK2s\",\"object\":\"chat.completion.chunk\",\"created\":1749734913,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_6cf3d04771c2ac3bb39f84bda06a167a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_6cf3d04771c2ac3bb39f84bda06a167a.json new file mode 100644 index 0000000000..ffebe190a2 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_6cf3d04771c2ac3bb39f84bda06a167a.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_YnjSjJMjzGnP8y21YoKQIWMS\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-color\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"This\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" is\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUU8SDOy30X1xkUimtQ0PAOGtV2\",\"object\":\"chat.completion.chunk\",\"created\":1752130574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_d0386ebc8dc8350f33c44c2251cd1d3c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_d0386ebc8dc8350f33c44c2251cd1d3c.json deleted file mode 100644 index 470a194567..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_d0386ebc8dc8350f33c44c2251cd1d3c.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_z1cGrTBqJgBc0GseaS3WXBNh\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-color\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"This\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" is\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGy4z7QkVU8KPbCBaLdbcKJ2skU\",\"object\":\"chat.completion.chunk\",\"created\":1749734924,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_83b1ed76da3ba0a764fdc6fb4d25e47a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_83b1ed76da3ba0a764fdc6fb4d25e47a.json deleted file mode 100644 index 4466dad13d..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_83b1ed76da3ba0a764fdc6fb4d25e47a.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_zVeMnTRvIWM9I9G9vY4MIhTu\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-color\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"This\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" is\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGzUYnBw1HKxejlfrPweJy8tELs\",\"object\":\"chat.completion.chunk\",\"created\":1749734925,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_b5e611d650819fc89af1f9ccfb59f24e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_b5e611d650819fc89af1f9ccfb59f24e.json new file mode 100644 index 0000000000..4ae8987e7a --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_b5e611d650819fc89af1f9ccfb59f24e.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_EurfjrAYHXyKxYf2dEqtmyTG\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-color\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"This\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" is\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUVcAJbLXQ2hxFTRFHUy3ozDIaq\",\"object\":\"chat.completion.chunk\",\"created\":1752130575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_016a76a8b508815af96b7185d6137346.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_016a76a8b508815af96b7185d6137346.json new file mode 100644 index 0000000000..0d37064315 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_016a76a8b508815af96b7185d6137346.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_QcXN5Dk2M74eKPWlYKLGXwUm\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUQqR3TcgXyJhrZ2bSlutf4m7os\",\"object\":\"chat.completion.chunk\",\"created\":1752130570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_dd48a67d4d41880db75515d0a95a53dc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_dd48a67d4d41880db75515d0a95a53dc.json deleted file mode 100644 index ae2211db89..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_dd48a67d4d41880db75515d0a95a53dc.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_KPdxgL4ikpGOGkMChNA69CKB\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGv50lycgEphMAJwCiO1os3ItPH\",\"object\":\"chat.completion.chunk\",\"created\":1749734921,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_a6321b1baeca3f0e777cc6f735d39599.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_a6321b1baeca3f0e777cc6f735d39599.json new file mode 100644 index 0000000000..d1d4928b2b --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_a6321b1baeca3f0e777cc6f735d39599.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_uikGUJFGNveS1Iiofhz0XBaP\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-color\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"This\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" is\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUZXmqWBuTfi9MuLhAxahunnGRx\",\"object\":\"chat.completion.chunk\",\"created\":1752130579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_e21784bb9948aac3dd70492535dff192.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_e21784bb9948aac3dd70492535dff192.json deleted file mode 100644 index a098eb8b2c..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_e21784bb9948aac3dd70492535dff192.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_rDAhasAUD1PF13ESS3pAYeCr\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-color\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"This\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" is\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH7mqKBkUy0ipIBGvLGvHomye32\",\"object\":\"chat.completion.chunk\",\"created\":1749734933,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_72b362e3a2e48e9e1d5dad68fc3da63c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_72b362e3a2e48e9e1d5dad68fc3da63c.json deleted file mode 100644 index 484b1ed2f2..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_72b362e3a2e48e9e1d5dad68fc3da63c.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the second block to german (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_IH4CpTADtxGlCEB7J2EVtm7E\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Wie\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" geht\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" es\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" dir\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-color\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Dieser\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" ist\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blau\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGwT6E3ojQpdgzyCJmVzqSnzNfY\",\"object\":\"chat.completion.chunk\",\"created\":1749734922,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_cd61b04f5a5a80de556e7524ab8efa7e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_cd61b04f5a5a80de556e7524ab8efa7e.json new file mode 100644 index 0000000000..ac58d3f071 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_cd61b04f5a5a80de556e7524ab8efa7e.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_FKQO4yAzQgFwEUZzzN4VgyMi\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Wie\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" geht\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" es\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" dir\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-color\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Dieser\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" ist\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blau\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_968bf60fd7c9520b848955d47ea8a568.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_968bf60fd7c9520b848955d47ea8a568.json deleted file mode 100644 index fa3cb80b01..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_968bf60fd7c9520b848955d47ea8a568.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_AC3IgyBnnR639x9H0IR6JbgD\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH3SEf51WH7kZxVqdj2daENt8dW\",\"object\":\"chat.completion.chunk\",\"created\":1749734929,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_dca280088154bf070ef536e89a0570c3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_dca280088154bf070ef536e89a0570c3.json new file mode 100644 index 0000000000..522cf49218 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_dca280088154bf070ef536e89a0570c3.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_hloQQxBP3UUwULUoYvrtHIcg\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUYcIWEcxytZs7tGD5va6xNMPMA\",\"object\":\"chat.completion.chunk\",\"created\":1752130578,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_2419100d41a8a73ec4a564889d7a57e9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_2419100d41a8a73ec4a564889d7a57e9.json new file mode 100644 index 0000000000..b98dd7f20b --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_2419100d41a8a73ec4a564889d7a57e9.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_iZUqIhom5xwPTb8kMZOW2id4\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_45c3fcc7757ac314a77786102326e125.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_45c3fcc7757ac314a77786102326e125.json deleted file mode 100644 index bc55f65984..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_45c3fcc7757ac314a77786102326e125.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_f2wg7Oi4bEBZiFJq87D3pwwU\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcH13MHy5TLwV8HlxlXkpKbEo3hA\",\"object\":\"chat.completion.chunk\",\"created\":1749734927,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_290252f83e798ac47770abfbb9bf6d73.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_290252f83e798ac47770abfbb9bf6d73.json new file mode 100644 index 0000000000..6e0ca4c606 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_290252f83e798ac47770abfbb9bf6d73.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 selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_ZmkQf2T2xmlXdDOB7UHj3Xkl\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUNY2BddzB9lLIx6spuQlXRyFM6\",\"object\":\"chat.completion.chunk\",\"created\":1752130567,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_8cfca4c1847085a8a31be1818346738e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_8cfca4c1847085a8a31be1818346738e.json deleted file mode 100644 index 7c7ceb2650..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_8cfca4c1847085a8a31be1818346738e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_f9QmgxwjWFS0vF41FJxMSZwG\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGoMKyPqaZH2YcspAsS5U4bBQnn\",\"object\":\"chat.completion.chunk\",\"created\":1749734914,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_2f31610c836b996af773c3856634d5c3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_2f31610c836b996af773c3856634d5c3.json deleted file mode 100644 index 10b1bf99aa..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_2f31610c836b996af773c3856634d5c3.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_7vFbI3cFknmwfTyk26ffG0IP\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ap\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ples\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ban\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"anas\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcHCBAsz9ja3JRhmW0bqxp1I9hBb\",\"object\":\"chat.completion.chunk\",\"created\":1749734938,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_a288987b44\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8103f7c569fd8326b0ae947eefd7d92d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8103f7c569fd8326b0ae947eefd7d92d.json new file mode 100644 index 0000000000..4d6743752f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8103f7c569fd8326b0ae947eefd7d92d.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 selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_rUETqt7C7MZKipUEacJ6h0kp\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ap\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ples\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ban\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"anas\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_282445e6005328e75fc2768da3503c3b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_282445e6005328e75fc2768da3503c3b.json new file mode 100644 index 0000000000..1c7755b6f4 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_282445e6005328e75fc2768da3503c3b.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_RyP5lQQKFbmbqg1T9ZcPmK9e\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"What's\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUPtDwA7znpMGOsp5vuUn4pYNi4\",\"object\":\"chat.completion.chunk\",\"created\":1752130569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_94cf62e3727b3443984720bc54218659.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_94cf62e3727b3443984720bc54218659.json deleted file mode 100644 index b14dee8772..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_94cf62e3727b3443984720bc54218659.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_gWAplvQH0Eo9eYQzir3tkBuY\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"What's\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGq1yJByaiUM9QhhlRWOpPVLAyF\",\"object\":\"chat.completion.chunk\",\"created\":1749734916,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_19432d3e11d58717813be52d54eb6edd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_19432d3e11d58717813be52d54eb6edd.json deleted file mode 100644 index 8434f20cb7..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_19432d3e11d58717813be52d54eb6edd.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$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 (MUST be a single HTML element)\"}}}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_RFH4GgQ3AspFWg6vDhLrddUd\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BhcGpjI5gmTgw0bEe8fDyj8cVfM9Z\",\"object\":\"chat.completion.chunk\",\"created\":1749734915,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"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/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_f1fcbe3b4b5404a79557569199effbf2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_f1fcbe3b4b5404a79557569199effbf2.json new file mode 100644 index 0000000000..7b5e3e371d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_f1fcbe3b4b5404a79557569199effbf2.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 List items are 1 block with 1 list item each, so block content `` is valid, but `` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_1APoaBf0WsgbwRf4iGA5a2Y7\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUO2XMWu4rtqyQTu6mZsQW6uIxJ\",\"object\":\"chat.completion.chunk\",\"created\":1752130568,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"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/tools/index.ts b/packages/xl-ai/src/api/formats/html-blocks/tools/index.ts index 054d809823..505712892c 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/tools/index.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/tools/index.ts @@ -17,13 +17,8 @@ export const tools = { description: "Insert new blocks", schema: { block: { - $ref: "#/$defs/block", - }, - $defs: { - block: { - type: "string", - description: "html of block (MUST be a single HTML element)", - }, + type: "string", + description: "html of block (MUST be a single HTML element)", }, }, validateBlock: validateBlockFunction, @@ -70,13 +65,8 @@ export const tools = { description: "Update a block", schema: { block: { - $ref: "#/$defs/block", - }, - $defs: { - block: { - type: "string", - description: "html of block (MUST be a single HTML element)", - }, + type: "string", + description: "html of block (MUST be a single HTML element)", }, }, validateBlock: validateBlockFunction, diff --git a/packages/xl-ai/src/testUtil/cases/updateOperationTestCases.ts b/packages/xl-ai/src/testUtil/cases/updateOperationTestCases.ts index 9d01431c7a..0d7f0f4dcb 100644 --- a/packages/xl-ai/src/testUtil/cases/updateOperationTestCases.ts +++ b/packages/xl-ai/src/testUtil/cases/updateOperationTestCases.ts @@ -194,7 +194,7 @@ export const updateOperationTestCases: DocumentOperationTestCase[] = [ }, ], userPrompt: - "translate the second block to german (use dir instead of Ihnen)", + "translate the second block including the greeting to German (use dir instead of Ihnen)", }, { editor: getEditorWithFormattingAndMentions,