@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.
- package/dist/blocknote-xl-ai.cjs +1 -1
- package/dist/blocknote-xl-ai.cjs.map +1 -1
- package/dist/blocknote-xl-ai.js +370 -369
- package/dist/blocknote-xl-ai.js.map +1 -1
- package/dist/{client-C4uaJa77.js → client-B0lU3j7B.js} +60 -29
- package/dist/client-B0lU3j7B.js.map +1 -0
- package/dist/client-CUJscXD0.cjs +36 -0
- package/dist/client-CUJscXD0.cjs.map +1 -0
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +9 -9
- package/src/AIExtension.ts +6 -2
- package/src/api/aiRequest/builder.ts +1 -1
- package/src/api/formats/base-tools/createUpdateBlockTool.ts +5 -3
- package/src/api/formats/base-tools/delete.ts +5 -1
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/src/api/formats/html-blocks/htmlBlocks.ts +1 -1
- package/src/api/formats/html-blocks/tools/rebaseTool.ts +6 -2
- package/src/api/formats/json/json.ts +1 -1
- package/src/api/formats/json/tools/jsontools.test.ts +12 -2
- package/src/api/formats/markdown-blocks/markdownBlocks.ts +1 -1
- package/src/api/formats/tests/validateTestEnvironment.test.ts +1 -0
- package/src/prosemirror/__snapshots__/agent.test.ts.snap +7 -0
- package/src/prosemirror/__snapshots__/changeset.test.ts.snap +28 -0
- package/src/prosemirror/agent.test.ts +14 -2
- package/src/prosemirror/changeset.test.ts +8 -2
- package/src/prosemirror/rebaseTool.ts +1 -1
- package/src/streamTool/filterValidOperations.ts +1 -0
- package/src/streamTool/preprocess.test.ts +32 -66
- package/src/streamTool/preprocess.ts +8 -38
- package/src/streamTool/toValidatedOperations.ts +12 -0
- package/src/streamTool/vercelAiSdk/util/chatHandlers.ts +2 -0
- package/src/testUtil/cases/combinedOperationsTestCases.ts +1 -1
- package/src/testUtil/cases/editors/simpleEditor.ts +15 -0
- package/src/testUtil/cases/index.ts +6 -1
- package/src/testUtil/cases/updateOperationTestCases.ts +30 -1
- package/src/testUtil/suggestChangesTestUtil.ts +1 -1
- package/types/src/streamTool/preprocess.d.ts +0 -13
- package/types/src/testUtil/cases/editors/simpleEditor.d.ts +268 -0
- package/dist/client-C4uaJa77.js.map +0 -1
- package/dist/client-DrruPiJu.cjs +0 -36
- package/dist/client-DrruPiJu.cjs.map +0 -1
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
package/dist/webpack-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"builtAt":
|
|
1
|
+
{"builtAt":1765974498764,"assets":[{"name":"server.cjs","size":1351},{"name":"blocknote-xl-ai.cjs","size":25759},{"name":"locales.cjs","size":23791},{"name":"client-CUJscXD0.cjs","size":40152},{"name":"client-CUJscXD0.cjs.map","size":202590},{"name":"server.cjs.map","size":91},{"name":"blocknote-xl-ai.cjs.map","size":2216055},{"name":"locales.cjs.map","size":55283}],"chunks":[{"id":"91fd206","entry":true,"initial":true,"files":["server.cjs"],"names":["server"]},{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote-xl-ai.cjs"],"names":["blocknote-xl-ai"]},{"id":"842df4c","entry":true,"initial":true,"files":["locales.cjs"],"names":["locales"]},{"id":"8392e5f","entry":false,"initial":true,"files":["client-CUJscXD0.cjs"],"names":["client"]}],"modules":[{"name":"./src/server.ts","size":0,"chunks":["91fd206"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/plugins/AgentCursorPlugin.ts","size":2444,"chunks":["a1ee98a"]},{"name":"./src/AIExtension.ts","size":11062,"chunks":["a1ee98a"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@19.2.1/node_modules/react-icons/lib/iconContext.mjs","size":251,"chunks":["a1ee98a"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@19.2.1/node_modules/react-icons/lib/iconBase.mjs","size":4003,"chunks":["a1ee98a"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@19.2.1/node_modules/react-icons/ri/index.mjs","size":6747,"chunks":["a1ee98a"]},{"name":"./src/hooks/useAIDictionary.ts","size":120,"chunks":["a1ee98a"]},{"name":"./src/components/AIMenu/PromptSuggestionMenu.tsx","size":2911,"chunks":["a1ee98a"]},{"name":"./src/components/AIMenu/getDefaultAIMenuItems.tsx","size":7846,"chunks":["a1ee98a"]},{"name":"./src/components/AIMenu/AIMenu.tsx","size":3596,"chunks":["a1ee98a"]},{"name":"./src/components/AIMenu/AIMenuController.tsx","size":2417,"chunks":["a1ee98a"]},{"name":"./src/components/FormattingToolbar/AIToolbarButton.tsx","size":960,"chunks":["a1ee98a"]},{"name":"./src/components/SuggestionMenu/getAISlashMenuItems.tsx","size":728,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ar.ts","size":1531,"chunks":["842df4c"]},{"name":"./src/i18n/locales/de.ts","size":1585,"chunks":["842df4c"]},{"name":"./src/i18n/locales/en.ts","size":1483,"chunks":["842df4c"]},{"name":"./src/i18n/locales/es.ts","size":1553,"chunks":["842df4c"]},{"name":"./src/i18n/locales/fr.ts","size":1569,"chunks":["842df4c"]},{"name":"./src/i18n/locales/he.ts","size":1401,"chunks":["842df4c"]},{"name":"./src/i18n/locales/hr.ts","size":1494,"chunks":["842df4c"]},{"name":"./src/i18n/locales/is.ts","size":1562,"chunks":["842df4c"]},{"name":"./src/i18n/locales/it.ts","size":1555,"chunks":["842df4c"]},{"name":"./src/i18n/locales/ja.ts","size":1372,"chunks":["842df4c"]},{"name":"./src/i18n/locales/ko.ts","size":1394,"chunks":["842df4c"]},{"name":"./src/i18n/locales/nl.ts","size":1536,"chunks":["842df4c"]},{"name":"./src/i18n/locales/no.ts","size":1509,"chunks":["842df4c"]},{"name":"./src/i18n/locales/pl.ts","size":1510,"chunks":["842df4c"]},{"name":"./src/i18n/locales/pt.ts","size":1548,"chunks":["842df4c"]},{"name":"./src/i18n/locales/ru.ts","size":1549,"chunks":["842df4c"]},{"name":"./src/i18n/locales/sk.ts","size":1511,"chunks":["842df4c"]},{"name":"./src/i18n/locales/uk.ts","size":1556,"chunks":["842df4c"]},{"name":"./src/i18n/locales/vi.ts","size":1506,"chunks":["842df4c"]},{"name":"./src/i18n/locales/zh-tw.ts","size":1345,"chunks":["842df4c"]},{"name":"./src/i18n/locales/zh.ts","size":1340,"chunks":["842df4c"]},{"name":"./src/i18n/locales/index.ts","size":0,"chunks":["842df4c"]},{"name":"./src/util/emptyBlock.ts","size":170,"chunks":["8392e5f"]},{"name":"./src/util/trimArray.ts","size":327,"chunks":["8392e5f"]},{"name":"./src/api/promptHelpers/trimEmptyBlocks.ts","size":272,"chunks":["8392e5f"]},{"name":"./src/api/aiRequest/builder.ts","size":1347,"chunks":["8392e5f"]},{"name":"./src/streamTool/jsonSchema.ts","size":1630,"chunks":["8392e5f"]},{"name":"./src/streamTool/ChunkExecutionError.ts","size":237,"chunks":["8392e5f"]},{"name":"./src/streamTool/StreamToolExecutor.ts","size":4984,"chunks":["8392e5f"]},{"name":"./src/streamTool/vercelAiSdk/util/injectDocumentStateMessages.ts","size":2819,"chunks":["8392e5f"]},{"name":"./src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts","size":2350,"chunks":["8392e5f"]},{"name":"./src/streamTool/vercelAiSdk/util/toolDefinitions.ts","size":680,"chunks":["8392e5f"]},{"name":"./src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts","size":3291,"chunks":["8392e5f"]},{"name":"./src/streamTool/vercelAiSdk/util/appendableStream.ts","size":1196,"chunks":["8392e5f"]},{"name":"./src/util/stream.ts","size":1069,"chunks":["8392e5f"]},{"name":"./src/streamTool/filterNewOrUpdatedOperations.ts","size":933,"chunks":["8392e5f"]},{"name":"./src/streamTool/filterValidOperations.ts","size":681,"chunks":["8392e5f"]},{"name":"./src/streamTool/toValidatedOperations.ts","size":1182,"chunks":["8392e5f"]},{"name":"./src/streamTool/preprocess.ts","size":594,"chunks":["8392e5f"]},{"name":"./src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts","size":306,"chunks":["8392e5f"]},{"name":"./src/streamTool/vercelAiSdk/util/chatHandlers.ts","size":4645,"chunks":["8392e5f"]},{"name":"./src/api/aiRequest/sendMessageWithAIRequest.ts","size":813,"chunks":["8392e5f"]},{"name":"./src/api/promptHelpers/addCursorPosition.ts","size":390,"chunks":["8392e5f"]},{"name":"./src/api/promptHelpers/convertBlocks.ts","size":183,"chunks":["8392e5f"]},{"name":"./src/api/promptHelpers/flattenBlocks.ts","size":162,"chunks":["8392e5f"]},{"name":"./src/api/promptHelpers/suffixIds.ts","size":204,"chunks":["8392e5f"]},{"name":"./src/api/formats/DocumentStateBuilder.ts","size":1985,"chunks":["8392e5f"]},{"name":"./src/prosemirror/fragmentUtil.ts","size":262,"chunks":["8392e5f"]},{"name":"./src/prosemirror/agent.ts","size":6220,"chunks":["8392e5f"]},{"name":"./src/prosemirror/changeset.ts","size":6000,"chunks":["8392e5f"]},{"name":"./src/streamTool/streamTool.ts","size":48,"chunks":["8392e5f"]},{"name":"./src/util/AbortError.ts","size":131,"chunks":["8392e5f"]},{"name":"./src/api/formats/base-tools/util/validateBlockArray.ts","size":574,"chunks":["8392e5f"]},{"name":"./src/api/formats/base-tools/createAddBlocksTool.ts","size":5549,"chunks":["8392e5f"]},{"name":"./src/api/formats/base-tools/createUpdateBlockTool.ts","size":4418,"chunks":["8392e5f"]},{"name":"./src/api/formats/base-tools/delete.ts","size":1869,"chunks":["8392e5f"]},{"name":"./src/api/formats/html-blocks/tools/getPartialHTML.ts","size":699,"chunks":["8392e5f"]},{"name":"./src/prosemirror/rebaseTool.ts","size":1508,"chunks":["8392e5f"]},{"name":"./src/api/formats/html-blocks/tools/rebaseTool.ts","size":893,"chunks":["8392e5f"]},{"name":"./src/api/formats/html-blocks/tools/validate.ts","size":204,"chunks":["8392e5f"]},{"name":"./src/api/formats/html-blocks/tools/index.ts","size":1886,"chunks":["8392e5f"]},{"name":"./src/api/formats/html-blocks/htmlBlocks.ts","size":2890,"chunks":["8392e5f"]},{"name":"./src/api/schema/mergeSchema.ts","size":829,"chunks":["8392e5f"]},{"name":"./src/api/schema/schemaToJSONSchema.ts","size":4910,"chunks":["8392e5f"]},{"name":"./src/api/formats/json/tools/validate.ts","size":1603,"chunks":["8392e5f"]},{"name":"./src/api/formats/json/tools/index.ts","size":1324,"chunks":["8392e5f"]},{"name":"./src/api/formats/json/json.ts","size":2550,"chunks":["8392e5f"]},{"name":"./src/api/formats/markdown-blocks/tools/rebaseTool.ts","size":633,"chunks":["8392e5f"]},{"name":"./src/api/formats/markdown-blocks/tools/validate.ts","size":202,"chunks":["8392e5f"]},{"name":"./src/api/formats/markdown-blocks/tools/index.ts","size":1505,"chunks":["8392e5f"]},{"name":"./src/api/formats/markdown-blocks/markdownBlocks.ts","size":2563,"chunks":["8392e5f"]},{"name":"./src/api/formats/formats.ts","size":149,"chunks":["8392e5f"]},{"name":"./src/api/promptHelpers/index.ts","size":112,"chunks":["8392e5f"]},{"name":"./src/i18n/dictionary.ts","size":150,"chunks":["8392e5f"]},{"name":"./src/blocknoteAIClient/client.ts","size":533,"chunks":["8392e5f"]}]}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "packages/xl-ai"
|
|
12
12
|
},
|
|
13
13
|
"license": "GPL-3.0 OR PROPRIETARY",
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.45.0",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
17
|
"types",
|
|
@@ -63,21 +63,21 @@
|
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@ai-sdk/provider-utils": "^3.0.17",
|
|
65
65
|
"@ai-sdk/react": "^2.0.102",
|
|
66
|
-
"@blocknote/core": "0.
|
|
67
|
-
"@blocknote/mantine": "0.
|
|
68
|
-
"@blocknote/
|
|
69
|
-
"@blocknote/react": "0.44.1",
|
|
66
|
+
"@blocknote/core": "0.45.0",
|
|
67
|
+
"@blocknote/mantine": "0.45.0",
|
|
68
|
+
"@blocknote/react": "0.45.0",
|
|
70
69
|
"@floating-ui/react": "^0.26.28",
|
|
71
|
-
"@
|
|
70
|
+
"@handlewithcare/prosemirror-suggest-changes": "^0.1.8",
|
|
71
|
+
"@tiptap/core": "^3.13.0",
|
|
72
72
|
"ai": "^5.0.102",
|
|
73
73
|
"lodash.isequal": "^4.5.0",
|
|
74
74
|
"lodash.merge": "^4.6.2",
|
|
75
75
|
"prosemirror-changeset": "^2.3.1",
|
|
76
76
|
"prosemirror-model": "^1.25.4",
|
|
77
77
|
"prosemirror-state": "^1.4.4",
|
|
78
|
-
"prosemirror-tables": "^1.8.
|
|
78
|
+
"prosemirror-tables": "^1.8.3",
|
|
79
79
|
"prosemirror-transform": "^1.10.5",
|
|
80
|
-
"prosemirror-view": "^1.41.
|
|
80
|
+
"prosemirror-view": "^1.41.4",
|
|
81
81
|
"react": "^19.2.1",
|
|
82
82
|
"react-dom": "^19.2.1",
|
|
83
83
|
"react-icons": "^5.5.0",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"@vitejs/plugin-react": "^4.7.0",
|
|
105
105
|
"@vitest/runner": "^2.1.9",
|
|
106
106
|
"eslint": "^8.57.1",
|
|
107
|
-
"glob": "^10.
|
|
107
|
+
"glob": "^10.5.0",
|
|
108
108
|
"headers-polyfill": "^4.0.3",
|
|
109
109
|
"msw": "^2.11.5",
|
|
110
110
|
"msw-snapshot": "^5.3.0",
|
package/src/AIExtension.ts
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
applySuggestions,
|
|
15
15
|
revertSuggestions,
|
|
16
16
|
suggestChanges,
|
|
17
|
-
} from "@
|
|
17
|
+
} from "@handlewithcare/prosemirror-suggest-changes";
|
|
18
18
|
import { UIMessage } from "ai";
|
|
19
19
|
import { Fragment, Slice } from "prosemirror-model";
|
|
20
20
|
import { Plugin, PluginKey } from "prosemirror-state";
|
|
@@ -75,6 +75,10 @@ export const AIExtension = createExtension(
|
|
|
75
75
|
| undefined;
|
|
76
76
|
let autoScroll = false;
|
|
77
77
|
|
|
78
|
+
const suggestChangesPlugin = suggestChanges();
|
|
79
|
+
// disable decorations for suggest changes, not needed
|
|
80
|
+
// (and the pilcrows are ugly)
|
|
81
|
+
suggestChangesPlugin.props.decorations = undefined;
|
|
78
82
|
return {
|
|
79
83
|
key: "ai",
|
|
80
84
|
options,
|
|
@@ -129,7 +133,7 @@ export const AIExtension = createExtension(
|
|
|
129
133
|
return true;
|
|
130
134
|
},
|
|
131
135
|
}),
|
|
132
|
-
|
|
136
|
+
suggestChangesPlugin,
|
|
133
137
|
createAgentCursorPlugin(
|
|
134
138
|
editorOptions?.agentCursor || { name: "AI", color: "#8bc6ff" },
|
|
135
139
|
),
|
|
@@ -51,7 +51,7 @@ export async function buildAIRequest(opts: {
|
|
|
51
51
|
: undefined;
|
|
52
52
|
|
|
53
53
|
const selectionInfo = useSelection
|
|
54
|
-
? opts.editor.getSelectionCutBlocks()
|
|
54
|
+
? opts.editor.getSelectionCutBlocks(true)
|
|
55
55
|
: undefined;
|
|
56
56
|
|
|
57
57
|
const streamTools = streamToolsProvider.getStreamTools(
|
|
@@ -143,11 +143,13 @@ export function createUpdateBlockTool<T>(config: {
|
|
|
143
143
|
const block = editor.getBlock(id);
|
|
144
144
|
|
|
145
145
|
if (!block) {
|
|
146
|
-
// eslint-disable-next-line no-console
|
|
147
|
-
console.error("BLOCK NOT FOUND", id);
|
|
148
146
|
return {
|
|
149
147
|
ok: false,
|
|
150
|
-
error: "
|
|
148
|
+
error: new Error("Block not found (update)", {
|
|
149
|
+
cause: {
|
|
150
|
+
blockId: id,
|
|
151
|
+
},
|
|
152
|
+
}),
|
|
151
153
|
};
|
|
152
154
|
}
|
|
153
155
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"request": {
|
|
3
|
+
"method": "POST",
|
|
4
|
+
"url": "https://api.anthropic.com/v1/messages",
|
|
5
|
+
"body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `<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 \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hello,</p>\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"<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\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' before the selection and translate selection to German\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}",
|
|
6
|
+
"headers": [],
|
|
7
|
+
"cookies": []
|
|
8
|
+
},
|
|
9
|
+
"response": {
|
|
10
|
+
"status": 200,
|
|
11
|
+
"statusText": "",
|
|
12
|
+
"body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"model\":\"claude-3-7-sonnet-20250219\",\"id\":\"msg_01ShvGBNzJJ3MxawfTjMRpGC\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1330,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":12,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01MJs8kbZd3hBYe5yn74u7cG\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"type\\\":\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"dd\\\",\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"feren\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ceId\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref2$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"po\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"sition\\\":\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"efore\\\",\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ks\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":[\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"<p>You \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"look great t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oday!</\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>\\\"]},\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"t\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\",\\\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref2$\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"<p\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\">Hallo,</p\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\">\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1330,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":133} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\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\":\"add a paragraph with the text 'You look great today!' before the selection and translate selection to German\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}",
|
|
6
|
+
"headers": [],
|
|
7
|
+
"cookies": []
|
|
8
|
+
},
|
|
9
|
+
"response": {
|
|
10
|
+
"status": 200,
|
|
11
|
+
"statusText": "",
|
|
12
|
+
"body": "data: {\"id\":\"chatcmpl-b558cf23-0d13-4cc7-a7e5-50cedcc3d3b9\",\"object\":\"chat.completion.chunk\",\"created\":1765889809,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_93b5f9e564\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01kckkr6g1fk1rt2hz0mppez98\",\"seed\":193584306}}\n\ndata: {\"id\":\"chatcmpl-b558cf23-0d13-4cc7-a7e5-50cedcc3d3b9\",\"object\":\"chat.completion.chunk\",\"created\":1765889809,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_93b5f9e564\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"q9cykhy7x\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo,\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-b558cf23-0d13-4cc7-a7e5-50cedcc3d3b9\",\"object\":\"chat.completion.chunk\",\"created\":1765889809,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_93b5f9e564\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01kckkr6g1fk1rt2hz0mppez98\",\"usage\":{\"queue_time\":0.141412944,\"prompt_tokens\":1007,\"prompt_time\":0.0689209,\"completion_tokens\":58,\"completion_time\":0.14751833,\"total_tokens\":1065,\"total_time\":0.21643923}},\"usage\":{\"queue_time\":0.141412944,\"prompt_tokens\":1007,\"prompt_time\":0.0689209,\"completion_tokens\":58,\"completion_time\":0.14751833,\"total_tokens\":1065,\"total_time\":0.21643923}}\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\\\":\\\"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\":\"add a paragraph with the text 'You look great today!' before the selection and translate selection 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_0f182b51faacc00e0069415709234c819097a3a554f874a458\",\"object\":\"response\",\"created_at\":1765889801,\"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_0f182b51faacc00e0069415709234c819097a3a554f874a458\",\"object\":\"response\",\"created_at\":1765889801,\"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_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"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_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"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_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"AVuHqSPaErSws9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"VFzRyw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"dR75X4pLKlQ6B\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"eSqHYnJtZOEuad\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Bvt6D3JkOVen\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hKeu2IeyzqvZv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"qhc0sFWicqoG2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"uI5QdaMoQ1QZ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"kQQq5ke\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"CFthkFq16uOHRv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"LB0UPneaIZbnS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"E5ZclP4Vx1W94\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"KL5iOBQoLsvwjCh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"pgYeJaOyIqB2XMo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"V5C9FnVdzCOGd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"hATQe321\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"L4c0HlySuMOGh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"epwwzbRRj2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"O6dxuu1yQRJtL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"yDdcv1fTxu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"xkNTU92xmUvr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"HgOsbFi4vZeSiXX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"XV517F5dlunC6Ba\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"siLUpasi1ly8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"fq20AnsX3aI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"wbZEahj94e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"8Tas7WKFdY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"!</\",\"logprobs\":[],\"obfuscation\":\"ZX7hRhTjLSTyH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"2bw1U6FuJA2VFcF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"IOv79naRuZDCxkM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"uA7EwHbipOhZPy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"WTAimcCXZqj2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"11IStyIEHpmC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"dp7qgzt3DA8mw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"oU2LZa9zrh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"FPu2b8a2pDnvv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"tJ56VqoYf1GvN5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WsoBxbDRwlHCM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"cAIQhWVqB2Qb3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"HaTE6MZTUldvMma\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ljRzOQqyhMZWfr5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ta9wU8csdjmto\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"rnmDM4saJ69\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"KQ9fGFGJyG9wZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"DZiN9gYw6a0ze0i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"IFB1iXfLqQDy9n7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"t0jJxK41TkXignY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"eiUO9aILfTY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"T0K8AEZ8e1hqH9J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"</\",\"logprobs\":[],\"obfuscation\":\"OqcgzEG6Sb2Rmn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"mB32Y9FbWwq6RZq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"o1ekLWSXkxK7yJU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"UTya0mykKdEIvC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"7pUPNlJJfCWMxC\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":58,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"<p>You look great today!</p>\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hallo,</p>\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":59,\"item_id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"<p>You look great today!</p>\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hallo,</p>\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":60,\"output_index\":0,\"item\":{\"id\":\"msg_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"<p>You look great today!</p>\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hallo,</p>\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":61,\"response\":{\"id\":\"resp_0f182b51faacc00e0069415709234c819097a3a554f874a458\",\"object\":\"response\",\"created_at\":1765889801,\"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_0f182b51faacc00e0069415709ad4c8190a69606edad6390d0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"<p>You look great today!</p>\\\"]},{\\\"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\":800,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":855},\"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\":\"add a paragraph with the text 'You look great today!' before the selection and translate selection to German\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"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_0788e64df71c1a5e006941570d858c8190bb023e348029cd9d\",\"object\":\"response\",\"created_at\":1765889805,\"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_0788e64df71c1a5e006941570d858c8190bb023e348029cd9d\",\"object\":\"response\",\"created_at\":1765889805,\"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_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_kfxCxrYe5hAo2nb1gU1UUxIT\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"MN9DKCGGyB2u6Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"hQ48FM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"vHTHlROj38kcE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"rNAYELyTqsAiWu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"OXksDPLUonV9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"YnyQOzps0xZ0E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"6sver5qpuSo9f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Sw1YUYVpMDn4p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"yVfRnzO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"Ba5CK905Ad8SCJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"OSXaKP0Uf27tK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"JOAGrEDsHHylL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"91Yg228Gn9TqmUi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"qfenJfQrywDBpLJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"EBozdkebJmIt6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"C7cbkQ5l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"tnVGz1XPsjNsx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"before\",\"obfuscation\":\"pGeyCP1GzD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"7bq9FALzdDStU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"86BFp5HUEY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"RQGtZ3bFzIRY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"SqhRXDfDxMLcP6l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"5hGZtD8ibFUlyhU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"hypFfRN6rYVM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"EcSlHyk4i6T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"x0AHYa2RgB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"MRxO1q7uov\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"!</\",\"obfuscation\":\"DWrNAJSwDTiev\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"yYbxSRgVElhH3OM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"PrqT6XdUnDDVbup\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"r7Q28vDl6YFHpz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"4AGhSYuQJRvM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"RozJf3JS6BMM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"gUgOlZVX2ocXK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"HyTXErhft9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"30efRMXZnCnUE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"24IUWlgLYLRopT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"uoulaZd7nGZDP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"MeuginqEgyVbD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"i6CJY5p1SnNiFgF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"vXWHBvLNLflhui2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"GUzyXzu0sonyq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"GcqvX8jpqxJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"IqS9J6ZwOMVET\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"7bZtv3mmTfIlpDc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"tnme77P4OPTv99d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"HX9ML2KqhmL5TJi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"PxMvBMkisyO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"9uCV5VQ9rvEYoW4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"</\",\"obfuscation\":\"irtCWagLtFBlsi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"xtp6VbuOIuxja4E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"BxzLbPsErcKmle1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"2fOobrDSDrGxOf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"lqQAFY6nhpZYM5\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":57,\"item_id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"<p>You look great today!</p>\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hallo,</p>\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":58,\"output_index\":0,\"item\":{\"id\":\"fc_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"<p>You look great today!</p>\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hallo,</p>\\\"}]}\",\"call_id\":\"call_kfxCxrYe5hAo2nb1gU1UUxIT\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":59,\"response\":{\"id\":\"resp_0788e64df71c1a5e006941570d858c8190bb023e348029cd9d\",\"object\":\"response\",\"created_at\":1765889805,\"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_0788e64df71c1a5e006941570e264c8190b74a621cde96562a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"<p>You look great today!</p>\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hallo,</p>\\\"}]}\",\"call_id\":\"call_kfxCxrYe5hAo2nb1gU1UUxIT\",\"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\":737,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":792},\"user\":null,\"metadata\":{}}}\n\n",
|
|
13
|
+
"headers": []
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"request": {
|
|
3
|
+
"method": "POST",
|
|
4
|
+
"url": "https://api.anthropic.com/v1/messages",
|
|
5
|
+
"body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `<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 \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"<p>Hello, world! Dow are you?</p>\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"<p>Hello, world! Dow are you?</p>\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"fix spelling\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}",
|
|
6
|
+
"headers": [],
|
|
7
|
+
"cookies": []
|
|
8
|
+
},
|
|
9
|
+
"response": {
|
|
10
|
+
"status": 200,
|
|
11
|
+
"statusText": "",
|
|
12
|
+
"body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"model\":\"claude-3-7-sonnet-20250219\",\"id\":\"msg_0129Ayon41jWACQWfx1w14PU\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1172,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01YU36AwspmcLRE3gbS9SbWf\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operations\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\\\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"i\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref1$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"block\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>Hell\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"o, world\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"! How a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" you?<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\">\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1172,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":86} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
|
|
13
|
+
"headers": []
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"request": {
|
|
3
|
+
"method": "POST",
|
|
4
|
+
"url": "https://api.anthropic.com/v1/messages",
|
|
5
|
+
"body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `<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 \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"<p>Hello,</p>\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"<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\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}",
|
|
6
|
+
"headers": [],
|
|
7
|
+
"cookies": []
|
|
8
|
+
},
|
|
9
|
+
"response": {
|
|
10
|
+
"status": 200,
|
|
11
|
+
"statusText": "",
|
|
12
|
+
"body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"model\":\"claude-3-7-sonnet-20250219\",\"id\":\"msg_0123aYbcTz94E62THFHWo8uc\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1312,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":12,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01C4ugqJx5t5u5HeUKiYyUgt\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"up\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"date\\\",\\\"id\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref2$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"<p>Ha\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"llo,</p>\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1312,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":82} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
|
|
13
|
+
"headers": []
|
|
14
|
+
}
|
|
15
|
+
}
|