@blocknote/xl-ai 0.44.1 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/blocknote-xl-ai.cjs +1 -1
  2. package/dist/blocknote-xl-ai.cjs.map +1 -1
  3. package/dist/blocknote-xl-ai.js +370 -369
  4. package/dist/blocknote-xl-ai.js.map +1 -1
  5. package/dist/{client-C4uaJa77.js → client-B0lU3j7B.js} +60 -29
  6. package/dist/client-B0lU3j7B.js.map +1 -0
  7. package/dist/client-CUJscXD0.cjs +36 -0
  8. package/dist/client-CUJscXD0.cjs.map +1 -0
  9. package/dist/server.cjs +1 -1
  10. package/dist/server.js +1 -1
  11. package/dist/webpack-stats.json +1 -1
  12. package/package.json +9 -9
  13. package/src/AIExtension.ts +6 -2
  14. package/src/api/aiRequest/builder.ts +1 -1
  15. package/src/api/formats/base-tools/createUpdateBlockTool.ts +5 -3
  16. package/src/api/formats/base-tools/delete.ts +5 -1
  17. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_ed2eea810db5ab73a8478e981735f2a6.json +15 -0
  18. package/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_9d907341d7a5b18529ccaf20cacbbe6f.json +15 -0
  19. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add paragraph and update selection_1_a7100ba9aeac25c6dbfc977b2325ae74.json +15 -0
  20. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_b6c3311e72a434273d25e4a6dc74731a.json +15 -0
  21. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/fix spelling mid-word selection_1_ce6692c22eda2a757e123681118a333d.json +15 -0
  22. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_1ad7d1a857e525e2d0f5a8c85b645a0e.json +15 -0
  23. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/fix spelling mid-word selection_1_8c47595610a6a2d15e1c5c751528e97a.json +15 -0
  24. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_59b3c2f2328276dc62dad98af951d63c.json +15 -0
  25. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/fix spelling mid-word selection_1_a6c5e74c3098077445378d6645e2672e.json +15 -0
  26. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_d51b8ed2dc61e8f8e333a3221be46316.json +15 -0
  27. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/fix spelling mid-word selection_1_d4b4abc5fa45932eec4efcc43bb337bd.json +15 -0
  28. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_e4b712a415f8af6f2b49382cac85ae77.json +15 -0
  29. package/src/api/formats/html-blocks/htmlBlocks.ts +1 -1
  30. package/src/api/formats/html-blocks/tools/rebaseTool.ts +6 -2
  31. package/src/api/formats/json/json.ts +1 -1
  32. package/src/api/formats/json/tools/jsontools.test.ts +12 -2
  33. package/src/api/formats/markdown-blocks/markdownBlocks.ts +1 -1
  34. package/src/api/formats/tests/validateTestEnvironment.test.ts +1 -0
  35. package/src/prosemirror/__snapshots__/agent.test.ts.snap +7 -0
  36. package/src/prosemirror/__snapshots__/changeset.test.ts.snap +28 -0
  37. package/src/prosemirror/agent.test.ts +14 -2
  38. package/src/prosemirror/changeset.test.ts +8 -2
  39. package/src/prosemirror/rebaseTool.ts +1 -1
  40. package/src/streamTool/filterValidOperations.ts +1 -0
  41. package/src/streamTool/preprocess.test.ts +32 -66
  42. package/src/streamTool/preprocess.ts +8 -38
  43. package/src/streamTool/toValidatedOperations.ts +12 -0
  44. package/src/streamTool/vercelAiSdk/util/chatHandlers.ts +2 -0
  45. package/src/testUtil/cases/combinedOperationsTestCases.ts +1 -1
  46. package/src/testUtil/cases/editors/simpleEditor.ts +15 -0
  47. package/src/testUtil/cases/index.ts +6 -1
  48. package/src/testUtil/cases/updateOperationTestCases.ts +30 -1
  49. package/src/testUtil/suggestChangesTestUtil.ts +1 -1
  50. package/types/src/streamTool/preprocess.d.ts +0 -13
  51. package/types/src/testUtil/cases/editors/simpleEditor.d.ts +268 -0
  52. package/dist/client-C4uaJa77.js.map +0 -1
  53. package/dist/client-DrruPiJu.cjs +0 -36
  54. package/dist/client-DrruPiJu.cjs.map +0 -1
  55. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_039451748eb07d71d3d7f96c97950d62.json +0 -15
  56. package/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_a7597ddda3f5117e1572545c53c19414.json +0 -15
  57. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add paragraph and update selection_1_bb81e06e77589983badfe53e3839ab83.json +0 -15
  58. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_8b11b2a66564f9985f33774d3862cd8c.json +0 -15
  59. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_885e9088214dbb6d50dcda19d0056f3c.json +0 -15
  60. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_1e9c30fa14f61508e6d90cbfa4d9b891.json +0 -15
  61. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_f82bcc59263074bf367562f7380b9cef.json +0 -15
  62. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_94c4e51be42ba73c81d7edc503e92b40.json +0 -15
@@ -0,0 +1,15 @@
1
+ {
2
+ "request": {
3
+ "method": "POST",
4
+ "url": "https://api.groq.com/openai/v1/chat/completions",
5
+ "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `<ul><li>item1</li></ul>` is valid, but `<ul><li>item1</li><li>item2</li></ul>` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a <code> block (wrapped with <pre>) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"<p>Hello, world! Dow are you?</p>\\\"}]This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):[{\\\"block\\\":\\\"<p>Hello, world! Dow are you?</p>\\\"}]\"},{\"role\":\"user\",\"content\":\"fix spelling\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}",
6
+ "headers": [],
7
+ "cookies": []
8
+ },
9
+ "response": {
10
+ "status": 200,
11
+ "statusText": "",
12
+ "body": "data: {\"id\":\"chatcmpl-db57f001-7d39-4009-a09d-b5b447701b05\",\"object\":\"chat.completion.chunk\",\"created\":1765889808,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f8b414701e\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01kckkr60zfk1rc6x2swm6b1sn\",\"seed\":920267309}}\n\ndata: {\"id\":\"chatcmpl-db57f001-7d39-4009-a09d-b5b447701b05\",\"object\":\"chat.completion.chunk\",\"created\":1765889808,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f8b414701e\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"stzv0835k\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! How are you?\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-db57f001-7d39-4009-a09d-b5b447701b05\",\"object\":\"chat.completion.chunk\",\"created\":1765889808,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f8b414701e\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01kckkr60zfk1rc6x2swm6b1sn\",\"usage\":{\"queue_time\":0.042992273,\"prompt_tokens\":872,\"prompt_time\":0.111533756,\"completion_tokens\":39,\"completion_time\":0.104265822,\"total_tokens\":911,\"total_time\":0.215799578}},\"usage\":{\"queue_time\":0.042992273,\"prompt_tokens\":872,\"prompt_time\":0.111533756,\"completion_tokens\":39,\"completion_time\":0.104265822,\"total_tokens\":911,\"total_time\":0.215799578}}\n\ndata: [DONE]\n\n",
13
+ "headers": []
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "request": {
3
+ "method": "POST",
4
+ "url": "https://api.groq.com/openai/v1/chat/completions",
5
+ "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `<ul><li>item1</li></ul>` is valid, but `<ul><li>item1</li><li>item2</li></ul>` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a <code> block (wrapped with <pre>) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hello,</p>\\\"}]This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):[{\\\"block\\\":\\\"<p>Hello, world!</p>\\\"},{\\\"block\\\":\\\"<p>Hello, <span data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\">@John Doe</span>! <strong>How are you doing?</strong> <span style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\">This text is blue!</span></p>\\\"},{\\\"block\\\":\\\"<p>Hello, world! <strong>Bold text. </strong><a target=\\\\\\\"_blank\\\\\\\" rel=\\\\\\\"noopener noreferrer nofollow\\\\\\\" href=\\\\\\\"https://www.google.com\\\\\\\">Link.</a></p>\\\"}]\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}",
6
+ "headers": [],
7
+ "cookies": []
8
+ },
9
+ "response": {
10
+ "status": 200,
11
+ "statusText": "",
12
+ "body": "data: {\"id\":\"chatcmpl-30b3770e-1f23-4c06-aecb-adffe081f52f\",\"object\":\"chat.completion.chunk\",\"created\":1765889877,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f8b414701e\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01kckkt8xhfqfv6aq6hpjqz7p0\",\"seed\":506923947}}\n\ndata: {\"id\":\"chatcmpl-30b3770e-1f23-4c06-aecb-adffe081f52f\",\"object\":\"chat.completion.chunk\",\"created\":1765889877,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f8b414701e\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"559899e8h\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo,\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-30b3770e-1f23-4c06-aecb-adffe081f52f\",\"object\":\"chat.completion.chunk\",\"created\":1765889877,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f8b414701e\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01kckkt8xhfqfv6aq6hpjqz7p0\",\"usage\":{\"queue_time\":0.04313261,\"prompt_tokens\":990,\"prompt_time\":0.048723412,\"completion_tokens\":34,\"completion_time\":0.104722486,\"total_tokens\":1024,\"total_time\":0.153445898}},\"usage\":{\"queue_time\":0.04313261,\"prompt_tokens\":990,\"prompt_time\":0.048723412,\"completion_tokens\":34,\"completion_time\":0.104722486,\"total_tokens\":1024,\"total_time\":0.153445898}}\n\ndata: [DONE]\n\n",
13
+ "headers": []
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "request": {
3
+ "method": "POST",
4
+ "url": "https://api.openai.com/v1/responses",
5
+ "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `<ul><li>item1</li></ul>` is valid, but `<ul><li>item1</li><li>item2</li></ul>` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a <code> block (wrapped with <pre>) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"<p>Hello, world! Dow are you?</p>\\\"}]\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"block\\\":\\\"<p>Hello, world! Dow are you?</p>\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"fix spelling\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}",
6
+ "headers": [],
7
+ "cookies": []
8
+ },
9
+ "response": {
10
+ "status": 200,
11
+ "statusText": "",
12
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_071f89d4475f07950069415707d2848194a62a8f930491c89e\",\"object\":\"response\",\"created_at\":1765889799,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_071f89d4475f07950069415707d2848194a62a8f930491c89e\",\"object\":\"response\",\"created_at\":1765889799,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Jn3F7UrSwwPbhU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"5BuP4S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"2qmqoD3KjCC9V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"wmNSxMDDXTRKVW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"h8PBPfPi6ZH2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"vvXiU0wuaYjvt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"PDQ7KNWqUL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"lZT7b1WEmrDkF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"AqQPp7fig0biwr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SV8TYnqW2neml\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"wXwqBkAeHhRWX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"p0zIURAzi8atjNY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"oqCbEes06g9RBKn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"I4AubFFH4Vw71\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"a00jpVtMPYX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"GIEEnfYVl0Gsa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"UzXOLqXbgiVQtI0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"b90s0R5xUC5phbN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"UILFSzIwOh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"VcHMULtBOczM9Ix\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"CySLouZVjC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"P7hrAeHL5RUccVs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\" How\",\"logprobs\":[],\"obfuscation\":\"cuWxsvzjUiaz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"I2rQLe2H1WVX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"Rp69SKNvNvXc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"?</\",\"logprobs\":[],\"obfuscation\":\"jwU6tPitVW062\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"MgdnkNBINjoBA6M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"XGbq87SKoB8O9fH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"2IHNG0TLkRAWrz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"Q0qHRofGz2bVzc\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"<p>Hello, world! How are you?</p>\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"<p>Hello, world! How are you?</p>\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"<p>Hello, world! How are you?</p>\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_071f89d4475f07950069415707d2848194a62a8f930491c89e\",\"object\":\"response\",\"created_at\":1765889799,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_071f89d4475f0795006941570821248194836911ebd4c98c3b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"<p>Hello, world! How are you?</p>\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":664,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":695},\"user\":null,\"metadata\":{}}}\n\n",
13
+ "headers": []
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "request": {
3
+ "method": "POST",
4
+ "url": "https://api.openai.com/v1/responses",
5
+ "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `<ul><li>item1</li></ul>` is valid, but `<ul><li>item1</li><li>item2</li></ul>` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a <code> block (wrapped with <pre>) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hello,</p>\\\"}]\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"block\\\":\\\"<p>Hello, world!</p>\\\"},{\\\"block\\\":\\\"<p>Hello, <span data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\">@John Doe</span>! <strong>How are you doing?</strong> <span style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\">This text is blue!</span></p>\\\"},{\\\"block\\\":\\\"<p>Hello, world! <strong>Bold text. </strong><a target=\\\\\\\"_blank\\\\\\\" rel=\\\\\\\"noopener noreferrer nofollow\\\\\\\" href=\\\\\\\"https://www.google.com\\\\\\\">Link.</a></p>\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}",
6
+ "headers": [],
7
+ "cookies": []
8
+ },
9
+ "response": {
10
+ "status": 200,
11
+ "statusText": "",
12
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_05669e6cb3bf9652006941571d07e4819387c5db2d7627ede7\",\"object\":\"response\",\"created_at\":1765889821,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_05669e6cb3bf9652006941571d07e4819387c5db2d7627ede7\",\"object\":\"response\",\"created_at\":1765889821,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"QXO3yTcNomfytO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"wIGCrF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Rygz4beMDfqYn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"xGRs0YQAT8gi5E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"o9VeCFahOeMZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"J8QFIlmKNFC4I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"kLINs3CPUX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qPPw8BA2sqMIk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"9O2eYXvazPBgpb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"6YvMJrpIfcHKD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"PbctsNYCcVdqG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"9Wa3xErY5l80Ngl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"STKmc6VtxZotLSz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Wzqj6QRyq1NeB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"OdG8dLePJST\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"i8RMLLSDf9QzU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"734ENHvWDY8RxKu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"vmDgHoiixvuA7WR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"yxpysAi9ggHRFcx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"7zZ8gosMgqn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"PEU4JqdAdp8Ri1l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"</\",\"logprobs\":[],\"obfuscation\":\"uJVJ9GfMkQe9V8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"nMezeYXbc04sO6K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"kOviNBJnsmKIvpG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"fIOdnMEzoCCH93\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"QDGFWDJKTgCiNM\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":30,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hallo,</p>\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":31,\"item_id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hallo,</p>\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hallo,</p>\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_05669e6cb3bf9652006941571d07e4819387c5db2d7627ede7\",\"object\":\"response\",\"created_at\":1765889821,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_05669e6cb3bf9652006941571d84c88193a2baf1d91ef2156d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hallo,</p>\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":783,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":810},\"user\":null,\"metadata\":{}}}\n\n",
13
+ "headers": []
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "request": {
3
+ "method": "POST",
4
+ "url": "https://api.openai.com/v1/responses",
5
+ "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `<ul><li>item1</li></ul>` is valid, but `<ul><li>item1</li><li>item2</li></ul>` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a <code> block (wrapped with <pre>) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"<p>Hello, world! Dow are you?</p>\\\"}]\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"block\\\":\\\"<p>Hello, world! Dow are you?</p>\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"fix spelling\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
6
+ "headers": [],
7
+ "cookies": []
8
+ },
9
+ "response": {
10
+ "status": 200,
11
+ "statusText": "",
12
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_042fe2d839f169e6006941570c09a88194b0f02f235f7c4cae\",\"object\":\"response\",\"created_at\":1765889804,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_042fe2d839f169e6006941570c09a88194b0f02f235f7c4cae\",\"object\":\"response\",\"created_at\":1765889804,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_xVdms3JXW8r7cEbsn20TS7lF\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"5XJkVWVEQyTWkA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"BH43cj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"NIVS0BXNG7GhN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"iwQFdJAzQL4CJ2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"2QIm9fK0UNl9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"2a6HLgfTIvd5H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"j1yEGEe9b3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"h6UtzXWpSpmlt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"lgJWDQSHHFpq3B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"LaO0LCjQF2rCG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"hCB2OE3dexCsN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"rnjMbnMQGrFpGvR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"5E3zGZdkLNhmiae\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"NPO2TVCritA0f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"qSNArKeAa0z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"XSyDp8IJTTzgV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"9fqQfEZxGzCV8y7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"JCchgszpR6QacGA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"St5TryqtMd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"wRvs7mQoffRK2lN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"bkcOfpw1GW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"yhkrAO7gOE5XOTW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\" How\",\"obfuscation\":\"CFKtGaFK4w14\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"O54cyIlpCWtq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"9yV7DUXCcCwh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"?</\",\"obfuscation\":\"ZUn450DlxDSHP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"xs93HCFyoJ3SVQP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"yKkK20DgwvP5H2l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"lEGlLUc04NBFtC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"iwEXg5As1kEs4t\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":33,\"item_id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"<p>Hello, world! How are you?</p>\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"<p>Hello, world! How are you?</p>\\\"}]}\",\"call_id\":\"call_xVdms3JXW8r7cEbsn20TS7lF\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_042fe2d839f169e6006941570c09a88194b0f02f235f7c4cae\",\"object\":\"response\",\"created_at\":1765889804,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_042fe2d839f169e6006941570c95088194b28e3648f31b1ef3\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"<p>Hello, world! How are you?</p>\\\"}]}\",\"call_id\":\"call_xVdms3JXW8r7cEbsn20TS7lF\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":601,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":632},\"user\":null,\"metadata\":{}}}\n\n",
13
+ "headers": []
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "request": {
3
+ "method": "POST",
4
+ "url": "https://api.openai.com/v1/responses",
5
+ "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `<ul><li>item1</li></ul>` is valid, but `<ul><li>item1</li><li>item2</li></ul>` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a <code> block (wrapped with <pre>) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hello,</p>\\\"}]\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"block\\\":\\\"<p>Hello, world!</p>\\\"},{\\\"block\\\":\\\"<p>Hello, <span data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\">@John Doe</span>! <strong>How are you doing?</strong> <span style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\">This text is blue!</span></p>\\\"},{\\\"block\\\":\\\"<p>Hello, world! <strong>Bold text. </strong><a target=\\\\\\\"_blank\\\\\\\" rel=\\\\\\\"noopener noreferrer nofollow\\\\\\\" href=\\\\\\\"https://www.google.com\\\\\\\">Link.</a></p>\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
6
+ "headers": [],
7
+ "cookies": []
8
+ },
9
+ "response": {
10
+ "status": 200,
11
+ "statusText": "",
12
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0c61b214458f7550006941570ac2d48197b2da26cfb52a89cb\",\"object\":\"response\",\"created_at\":1765889802,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_0c61b214458f7550006941570ac2d48197b2da26cfb52a89cb\",\"object\":\"response\",\"created_at\":1765889802,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_ifs8tpgLs6457q1qDUtZIqr8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"MlgbFc65TqiJDr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"rhvi8l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"rsl3JJtRCZ1AJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"IPz6Q5M6bJVBEt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"0r9Y54LztrOh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"kckzZMeVEpWjf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"vX3kkP5IVo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"3EWXedtGBlBQL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"KrvbKiIQYB8buV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"poEtzlp6iSObI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"1HxsE8ARNLbHH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"OahB3xU9JYme0lV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"Uz6VF04Q8zVZ7ij\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"tgscER8ibwqqm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"AxAGXD9j4HQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"fZjEQfjqZWjpw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"YBacuyoH6w6ZNPE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"t7leJhCfsod2X2H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"YWOLTuvpMMZtYi3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"vzAkMvYwlL8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"JeRZ94BPIsGfifx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"</\",\"obfuscation\":\"aDH8jLVTytDwDB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"ckDZMze4SVLbR31\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"ATIsu7tRjLdmngG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"aN0ui9gfz012s3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"qDH3OletWxvhZD\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":29,\"item_id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hallo,</p>\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":30,\"output_index\":0,\"item\":{\"id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hallo,</p>\\\"}]}\",\"call_id\":\"call_ifs8tpgLs6457q1qDUtZIqr8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":31,\"response\":{\"id\":\"resp_0c61b214458f7550006941570ac2d48197b2da26cfb52a89cb\",\"object\":\"response\",\"created_at\":1765889802,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_0c61b214458f7550006941570b48c48197a6b690e59284d35a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hallo,</p>\\\"}]}\",\"call_id\":\"call_ifs8tpgLs6457q1qDUtZIqr8\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":720,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":747},\"user\":null,\"metadata\":{}}}\n\n",
13
+ "headers": []
14
+ }
15
+ }
@@ -24,7 +24,7 @@ function getStreamTools<
24
24
  ): StreamToolsResult<string, T> {
25
25
  if (typeof selectionInfo === "boolean") {
26
26
  const selection = selectionInfo
27
- ? editor.getSelectionCutBlocks()
27
+ ? editor.getSelectionCutBlocks(true)
28
28
  : undefined;
29
29
 
30
30
  selectionInfo = selection
@@ -48,8 +48,12 @@ export async function createHTMLRebaseTool(
48
48
  );
49
49
 
50
50
  if (steps.length) {
51
- // console.error("html diff", steps);
52
- throw new Error("html diff");
51
+ throw new Error("html diff", {
52
+ cause: {
53
+ html,
54
+ htmlBlock
55
+ }
56
+ });
53
57
  }
54
58
 
55
59
  return rebaseTool(editor, tr);
@@ -28,7 +28,7 @@ function getStreamTools<
28
28
  ): StreamToolsResult<string, T> {
29
29
  if (typeof selectionInfo === "boolean") {
30
30
  const selection = selectionInfo
31
- ? editor.getSelectionCutBlocks()
31
+ ? editor.getSelectionCutBlocks(true)
32
32
  : undefined;
33
33
 
34
34
  selectionInfo = selection
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable jest/valid-title */
2
- import { BlockNoteEditor } from "@blocknote/core";
2
+ import { BlockNoteEditor, expandPMRangeToWords } from "@blocknote/core";
3
3
  import { describe, expect, it } from "vitest";
4
4
  import { addOperationTestCases } from "../../../../testUtil/cases/addOperationTestCases.js";
5
5
  import { combinedOperationsTestCases } from "../../../../testUtil/cases/combinedOperationsTestCases.js";
@@ -44,12 +44,22 @@ async function executeTestCase(
44
44
  testCase: DocumentOperationTestCase,
45
45
  ) {
46
46
  const originalDoc = editor.prosemirrorState.doc;
47
+ let selection: { from: number; to: number } | undefined =
48
+ testCase.getTestSelection?.(editor);
49
+
50
+ if (selection) {
51
+ selection = expandPMRangeToWords(editor.prosemirrorState.doc, {
52
+ $from: editor.prosemirrorState.doc.resolve(selection.from),
53
+ $to: editor.prosemirrorState.doc.resolve(selection.to),
54
+ });
55
+ }
56
+
47
57
  const streamTools = [
48
58
  tools.add(editor, { idsSuffixed: true, withDelays: false }),
49
59
  tools.update(editor, {
50
60
  idsSuffixed: true,
51
61
  withDelays: false,
52
- updateSelection: testCase.getTestSelection?.(editor),
62
+ updateSelection: selection,
53
63
  }),
54
64
  tools.delete(editor, { idsSuffixed: true, withDelays: false }),
55
65
  ];
@@ -28,7 +28,7 @@ function getStreamTools<
28
28
  ): StreamToolsResult<string, T> {
29
29
  if (typeof selectionInfo === "boolean") {
30
30
  const selection = selectionInfo
31
- ? editor.getSelectionCutBlocks()
31
+ ? editor.getSelectionCutBlocks(true)
32
32
  : undefined;
33
33
 
34
34
  selectionInfo = selection
@@ -41,6 +41,7 @@ describe("MSW Snapshots", () => {
41
41
  files: files,
42
42
  }));
43
43
 
44
+ // const rmSync = await import("fs").then((m) => m.rmSync);
44
45
  // for (const duplicate of duplicates) {
45
46
  // for (const file of duplicate.files) {
46
47
  // rmSync(file);
@@ -35,6 +35,13 @@ exports[`agentStepToTr > Update > drop mark and link and change text within mark
35
35
  ]
36
36
  `;
37
37
 
38
+ exports[`agentStepToTr > Update > fix spelling mid-word selection 1`] = `
39
+ [
40
+ "S {"type":"doc","content":[{"type":"blockGroup","content":[{"type":"blockContainer","attrs":{"id":"ref1"},"content":[{"type":"paragraph","attrs":{"backgroundColor":"default","textColor":"default","textAlignment":"left"},"content":[{"type":"text","text":"Hello, world! Dow are you?"}]}]}]}]}",
41
+ "R {"type":"doc","content":[{"type":"blockGroup","content":[{"type":"blockContainer","attrs":{"id":"ref1"},"content":[{"type":"paragraph","attrs":{"backgroundColor":"default","textColor":"default","textAlignment":"left"},"content":[{"type":"text","text":"Hello, world! "},{"type":"text","marks":[{"type":"deletion","attrs":{"id":null}}],"text":"D"},{"type":"text","marks":[{"type":"insertion","attrs":{"id":null}}],"text":"H"},{"type":"text","text":"ow are you?"}]}]}]}]}",
42
+ ]
43
+ `;
44
+
38
45
  exports[`agentStepToTr > Update > modify nested content 1`] = `
39
46
  [
40
47
  "S {"type":"doc","content":[{"type":"blockGroup","content":[{"type":"blockContainer","attrs":{"id":"ref1"},"content":[{"type":"paragraph","attrs":{"backgroundColor":"default","textColor":"default","textAlignment":"left"},"content":[{"type":"text","text":"I need to buy:"}]},{"type":"blockGroup","content":[{"type":"blockContainer","attrs":{"id":"ref2"},"content":[{"type":"paragraph","attrs":{"backgroundColor":"default","textColor":"default","textAlignment":"left"},"content":[{"type":"text","text":"Apples"}]}]}]}]}]}]}",
@@ -279,6 +279,34 @@ exports[`drop mark and link and change text within mark 1`] = `
279
279
  ]
280
280
  `;
281
281
 
282
+ exports[`fix spelling mid-word selection 1`] = `
283
+ [
284
+ {
285
+ "replaced": {
286
+ "content": [
287
+ {
288
+ "text": "D",
289
+ "type": "text",
290
+ },
291
+ ],
292
+ },
293
+ "step": {
294
+ "from": 17,
295
+ "slice": {
296
+ "content": [
297
+ {
298
+ "text": "H",
299
+ "type": "text",
300
+ },
301
+ ],
302
+ },
303
+ "stepType": "replace",
304
+ "to": 18,
305
+ },
306
+ },
307
+ ]
308
+ `;
309
+
282
310
  exports[`modify nested content 1`] = `
283
311
  [
284
312
  {
@@ -1,4 +1,9 @@
1
- import { BlockNoteEditor, getBlockInfo, getNodeById } from "@blocknote/core";
1
+ import {
2
+ BlockNoteEditor,
3
+ expandPMRangeToWords,
4
+ getBlockInfo,
5
+ getNodeById,
6
+ } from "@blocknote/core";
2
7
  import { Fragment, Slice } from "prosemirror-model";
3
8
  import { ReplaceStep, Transform } from "prosemirror-transform";
4
9
  import { describe, expect, it } from "vitest";
@@ -213,7 +218,14 @@ async function executeTestCase(
213
218
  const blockId = updateOp.id;
214
219
  const update = updateOp.block;
215
220
 
216
- const selection = test.getTestSelection?.(editor);
221
+ let selection = test.getTestSelection?.(editor);
222
+
223
+ if (selection) {
224
+ selection = expandPMRangeToWords(editor.prosemirrorState.doc, {
225
+ $from: editor.prosemirrorState.doc.resolve(selection.from),
226
+ $to: editor.prosemirrorState.doc.resolve(selection.to),
227
+ });
228
+ }
217
229
 
218
230
  const steps = updateToReplaceSteps(
219
231
  {
@@ -1,4 +1,4 @@
1
- import { BlockNoteEditor } from "@blocknote/core";
1
+ import { BlockNoteEditor, expandPMRangeToWords } from "@blocknote/core";
2
2
  import { describe, expect, it } from "vitest";
3
3
  import { getEditorWithFormattingAndMentions } from "../testUtil/cases/editors/formattingAndMentions.js";
4
4
  import {
@@ -18,7 +18,13 @@ function executeTestCase(
18
18
  }
19
19
  const blockId = update.id;
20
20
 
21
- const selection = test.getTestSelection?.(editor);
21
+ let selection = test.getTestSelection?.(editor);
22
+ if (selection) {
23
+ selection = expandPMRangeToWords(editor.prosemirrorState.doc, {
24
+ $from: editor.prosemirrorState.doc.resolve(selection.from),
25
+ $to: editor.prosemirrorState.doc.resolve(selection.to),
26
+ });
27
+ }
22
28
  const steps = updateToReplaceSteps(
23
29
  {
24
30
  id: blockId,
@@ -1,5 +1,5 @@
1
1
  import { BlockNoteEditor } from "@blocknote/core";
2
- import { applySuggestions } from "@blocknote/prosemirror-suggest-changes";
2
+ import { applySuggestions } from "@handlewithcare/prosemirror-suggest-changes";
3
3
  import { Transaction } from "prosemirror-state";
4
4
  import { Transform } from "prosemirror-transform";
5
5